diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl4965-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 181 |
1 files changed, 0 insertions, 181 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 46a43ff51526..2ed69376c96e 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -161,17 +161,6 @@ static const char *iwl4965_escape_essid(const char *essid, u8 essid_len) | |||
161 | return escaped; | 161 | return escaped; |
162 | } | 162 | } |
163 | 163 | ||
164 | static void iwl4965_print_hex_dump(int level, void *p, u32 len) | ||
165 | { | ||
166 | #ifdef CONFIG_IWL4965_DEBUG | ||
167 | if (!(iwl4965_debug_level & level)) | ||
168 | return; | ||
169 | |||
170 | print_hex_dump(KERN_DEBUG, "iwl data: ", DUMP_PREFIX_OFFSET, 16, 1, | ||
171 | p, len, 1); | ||
172 | #endif | ||
173 | } | ||
174 | |||
175 | /*************** DMA-QUEUE-GENERAL-FUNCTIONS ***** | 164 | /*************** DMA-QUEUE-GENERAL-FUNCTIONS ***** |
176 | * DMA services | 165 | * DMA services |
177 | * | 166 | * |
@@ -1551,34 +1540,6 @@ unsigned int iwl4965_fill_beacon_frame(struct iwl4965_priv *priv, | |||
1551 | return priv->ibss_beacon->len; | 1540 | return priv->ibss_beacon->len; |
1552 | } | 1541 | } |
1553 | 1542 | ||
1554 | int iwl4965_rate_index_from_plcp(int plcp) | ||
1555 | { | ||
1556 | int i = 0; | ||
1557 | |||
1558 | /* 4965 HT rate format */ | ||
1559 | if (plcp & RATE_MCS_HT_MSK) { | ||
1560 | i = (plcp & 0xff); | ||
1561 | |||
1562 | if (i >= IWL_RATE_MIMO_6M_PLCP) | ||
1563 | i = i - IWL_RATE_MIMO_6M_PLCP; | ||
1564 | |||
1565 | i += IWL_FIRST_OFDM_RATE; | ||
1566 | /* skip 9M not supported in ht*/ | ||
1567 | if (i >= IWL_RATE_9M_INDEX) | ||
1568 | i += 1; | ||
1569 | if ((i >= IWL_FIRST_OFDM_RATE) && | ||
1570 | (i <= IWL_LAST_OFDM_RATE)) | ||
1571 | return i; | ||
1572 | |||
1573 | /* 4965 legacy rate format, search for match in table */ | ||
1574 | } else { | ||
1575 | for (i = 0; i < ARRAY_SIZE(iwl4965_rates); i++) | ||
1576 | if (iwl4965_rates[i].plcp == (plcp &0xFF)) | ||
1577 | return i; | ||
1578 | } | ||
1579 | return -1; | ||
1580 | } | ||
1581 | |||
1582 | static u8 iwl4965_rate_get_lowest_plcp(int rate_mask) | 1543 | static u8 iwl4965_rate_get_lowest_plcp(int rate_mask) |
1583 | { | 1544 | { |
1584 | u8 i; | 1545 | u8 i; |
@@ -1712,148 +1673,6 @@ done: | |||
1712 | * Misc. internal state and helper functions | 1673 | * Misc. internal state and helper functions |
1713 | * | 1674 | * |
1714 | ******************************************************************************/ | 1675 | ******************************************************************************/ |
1715 | #ifdef CONFIG_IWL4965_DEBUG | ||
1716 | |||
1717 | /** | ||
1718 | * iwl4965_report_frame - dump frame to syslog during debug sessions | ||
1719 | * | ||
1720 | * You may hack this function to show different aspects of received frames, | ||
1721 | * including selective frame dumps. | ||
1722 | * group100 parameter selects whether to show 1 out of 100 good frames. | ||
1723 | * | ||
1724 | * TODO: This was originally written for 3945, need to audit for | ||
1725 | * proper operation with 4965. | ||
1726 | */ | ||
1727 | void iwl4965_report_frame(struct iwl4965_priv *priv, | ||
1728 | struct iwl4965_rx_packet *pkt, | ||
1729 | struct ieee80211_hdr *header, int group100) | ||
1730 | { | ||
1731 | u32 to_us; | ||
1732 | u32 print_summary = 0; | ||
1733 | u32 print_dump = 0; /* set to 1 to dump all frames' contents */ | ||
1734 | u32 hundred = 0; | ||
1735 | u32 dataframe = 0; | ||
1736 | u16 fc; | ||
1737 | u16 seq_ctl; | ||
1738 | u16 channel; | ||
1739 | u16 phy_flags; | ||
1740 | int rate_sym; | ||
1741 | u16 length; | ||
1742 | u16 status; | ||
1743 | u16 bcn_tmr; | ||
1744 | u32 tsf_low; | ||
1745 | u64 tsf; | ||
1746 | u8 rssi; | ||
1747 | u8 agc; | ||
1748 | u16 sig_avg; | ||
1749 | u16 noise_diff; | ||
1750 | struct iwl4965_rx_frame_stats *rx_stats = IWL_RX_STATS(pkt); | ||
1751 | struct iwl4965_rx_frame_hdr *rx_hdr = IWL_RX_HDR(pkt); | ||
1752 | struct iwl4965_rx_frame_end *rx_end = IWL_RX_END(pkt); | ||
1753 | u8 *data = IWL_RX_DATA(pkt); | ||
1754 | |||
1755 | /* MAC header */ | ||
1756 | fc = le16_to_cpu(header->frame_control); | ||
1757 | seq_ctl = le16_to_cpu(header->seq_ctrl); | ||
1758 | |||
1759 | /* metadata */ | ||
1760 | channel = le16_to_cpu(rx_hdr->channel); | ||
1761 | phy_flags = le16_to_cpu(rx_hdr->phy_flags); | ||
1762 | rate_sym = rx_hdr->rate; | ||
1763 | length = le16_to_cpu(rx_hdr->len); | ||
1764 | |||
1765 | /* end-of-frame status and timestamp */ | ||
1766 | status = le32_to_cpu(rx_end->status); | ||
1767 | bcn_tmr = le32_to_cpu(rx_end->beacon_timestamp); | ||
1768 | tsf_low = le64_to_cpu(rx_end->timestamp) & 0x0ffffffff; | ||
1769 | tsf = le64_to_cpu(rx_end->timestamp); | ||
1770 | |||
1771 | /* signal statistics */ | ||
1772 | rssi = rx_stats->rssi; | ||
1773 | agc = rx_stats->agc; | ||
1774 | sig_avg = le16_to_cpu(rx_stats->sig_avg); | ||
1775 | noise_diff = le16_to_cpu(rx_stats->noise_diff); | ||
1776 | |||
1777 | to_us = !compare_ether_addr(header->addr1, priv->mac_addr); | ||
1778 | |||
1779 | /* if data frame is to us and all is good, | ||
1780 | * (optionally) print summary for only 1 out of every 100 */ | ||
1781 | if (to_us && (fc & ~IEEE80211_FCTL_PROTECTED) == | ||
1782 | (IEEE80211_FCTL_FROMDS | IEEE80211_FTYPE_DATA)) { | ||
1783 | dataframe = 1; | ||
1784 | if (!group100) | ||
1785 | print_summary = 1; /* print each frame */ | ||
1786 | else if (priv->framecnt_to_us < 100) { | ||
1787 | priv->framecnt_to_us++; | ||
1788 | print_summary = 0; | ||
1789 | } else { | ||
1790 | priv->framecnt_to_us = 0; | ||
1791 | print_summary = 1; | ||
1792 | hundred = 1; | ||
1793 | } | ||
1794 | } else { | ||
1795 | /* print summary for all other frames */ | ||
1796 | print_summary = 1; | ||
1797 | } | ||
1798 | |||
1799 | if (print_summary) { | ||
1800 | char *title; | ||
1801 | u32 rate; | ||
1802 | |||
1803 | if (hundred) | ||
1804 | title = "100Frames"; | ||
1805 | else if (fc & IEEE80211_FCTL_RETRY) | ||
1806 | title = "Retry"; | ||
1807 | else if (ieee80211_is_assoc_response(fc)) | ||
1808 | title = "AscRsp"; | ||
1809 | else if (ieee80211_is_reassoc_response(fc)) | ||
1810 | title = "RasRsp"; | ||
1811 | else if (ieee80211_is_probe_response(fc)) { | ||
1812 | title = "PrbRsp"; | ||
1813 | print_dump = 1; /* dump frame contents */ | ||
1814 | } else if (ieee80211_is_beacon(fc)) { | ||
1815 | title = "Beacon"; | ||
1816 | print_dump = 1; /* dump frame contents */ | ||
1817 | } else if (ieee80211_is_atim(fc)) | ||
1818 | title = "ATIM"; | ||
1819 | else if (ieee80211_is_auth(fc)) | ||
1820 | title = "Auth"; | ||
1821 | else if (ieee80211_is_deauth(fc)) | ||
1822 | title = "DeAuth"; | ||
1823 | else if (ieee80211_is_disassoc(fc)) | ||
1824 | title = "DisAssoc"; | ||
1825 | else | ||
1826 | title = "Frame"; | ||
1827 | |||
1828 | rate = iwl4965_rate_index_from_plcp(rate_sym); | ||
1829 | if (rate == -1) | ||
1830 | rate = 0; | ||
1831 | else | ||
1832 | rate = iwl4965_rates[rate].ieee / 2; | ||
1833 | |||
1834 | /* print frame summary. | ||
1835 | * MAC addresses show just the last byte (for brevity), | ||
1836 | * but you can hack it to show more, if you'd like to. */ | ||
1837 | if (dataframe) | ||
1838 | IWL_DEBUG_RX("%s: mhd=0x%04x, dst=0x%02x, " | ||
1839 | "len=%u, rssi=%d, chnl=%d, rate=%u, \n", | ||
1840 | title, fc, header->addr1[5], | ||
1841 | length, rssi, channel, rate); | ||
1842 | else { | ||
1843 | /* src/dst addresses assume managed mode */ | ||
1844 | IWL_DEBUG_RX("%s: 0x%04x, dst=0x%02x, " | ||
1845 | "src=0x%02x, rssi=%u, tim=%lu usec, " | ||
1846 | "phy=0x%02x, chnl=%d\n", | ||
1847 | title, fc, header->addr1[5], | ||
1848 | header->addr3[5], rssi, | ||
1849 | tsf_low - priv->scan_start_tsf, | ||
1850 | phy_flags, channel); | ||
1851 | } | ||
1852 | } | ||
1853 | if (print_dump) | ||
1854 | iwl4965_print_hex_dump(IWL_DL_RX, data, length); | ||
1855 | } | ||
1856 | #endif | ||
1857 | 1676 | ||
1858 | static void iwl4965_unset_hw_setting(struct iwl4965_priv *priv) | 1677 | static void iwl4965_unset_hw_setting(struct iwl4965_priv *priv) |
1859 | { | 1678 | { |