Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'staging-6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging driver updates from Greg KH:
"Here is the "big" set of staging driver changes for 6.8-rc1. It's not
really that big this release cycle, not much happened except for 186
patches of coding style cleanups. The majority was in the rtl8192e
driver, but there are other smaller changes in a few other staging
drivers, full details in the shortlog.

All of these have been in linux-next for a while with no reported
issues"

* tag 'staging-6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (186 commits)
Staging: rtl8192e: Rename variable OpMode
Staging: rtl8192e: Rename variable bIsAggregateFrame
Staging: rtl8192e: Rename function rtllib_EnableNetMonitorMode()
Staging: rtl8192e: Rename variable NumRxOkInPeriod
Staging: rtl8192e: Rename variable NumTxOkInPeriod
Staging: rtl8192e: Rename variable bUsed
staging: vme_user: print more detailed infomation when an error occurs
Staging: rtl8192e: Rename function rtllib_DisableNetMonitorMode()
Staging: rtl8192e: Rename variable bInitState
Staging: rtl8192e: Rename variable skb_waitQ
Staging: rtl8192e: Rename variable BasicRate
Staging: rtl8192e: Rename variable QueryRate
Staging: rtl8192e: Rename function rtllib_TURBO_Info()
Staging: rtl8192e: Rename function rtllib_WMM_Info()
Staging: rtl8192e: Rename function rtllib_MFIE_Grate()
Staging: rtl8192e: Rename function rtllib_MFIE_Brate()
Staging: rtl8192e: Fixup statement broken across 2 lines in rtllib_softmac_new_net()
Staging: rtl8192e: Fixup statement broken across 2 lines in rtllib_softmac_xmit()
Staging: rtl8192e: Fix function definition broken across multiple lines
Staging: rtl8192e: Fix statement broken across 2 lines in rtllib_rx_assoc_resp()
...

+1261 -2420
+8
CREDITS
··· 3950 3950 S: Cupertino, CA 95014 3951 3951 S: USA 3952 3952 3953 + N: Manohar Vanga 3954 + E: manohar.vanga@gmail.com 3955 + D: VME subsystem maintainer 3956 + 3953 3957 N: Thibaut Varène 3954 3958 E: hacks+kernel@slashdirt.org 3955 3959 W: http://hacks.slashdirt.org/ ··· 4053 4049 D: Fixes for the NE/2-driver 4054 4050 D: Miscellaneous MCA-support 4055 4051 D: Cleanup of the Config-files 4052 + 4053 + N: Martyn Welch 4054 + E: martyn@welchs.me.uk 4055 + D: VME subsystem maintainer 4056 4056 4057 4057 N: Matt Welsh 4058 4058 E: mdw@metalab.unc.edu
+1 -4
MAINTAINERS
··· 23407 23407 F: mm/vmalloc.c 23408 23408 23409 23409 VME SUBSYSTEM 23410 - M: Martyn Welch <martyn@welchs.me.uk> 23411 - M: Manohar Vanga <manohar.vanga@gmail.com> 23412 - M: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 23413 23410 L: linux-kernel@vger.kernel.org 23414 - S: Odd fixes 23411 + S: Orphan 23415 23412 T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 23416 23413 F: Documentation/driver-api/vme.rst 23417 23414 F: drivers/staging/vme_user/
-1
drivers/staging/rtl8192e/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 rtllib-objs := \ 3 - dot11d.o \ 4 3 rtllib_module.o \ 5 4 rtllib_rx.o \ 6 5 rtllib_tx.o \
-165
drivers/staging/rtl8192e/dot11d.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - /****************************************************************************** 3 - * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved. 4 - * 5 - * Contact Information: 6 - * wlanfae <wlanfae@realtek.com> 7 - ******************************************************************************/ 8 - #include "dot11d.h" 9 - 10 - struct channel_list { 11 - u8 channel[32]; 12 - u8 len; 13 - }; 14 - 15 - static struct channel_list channel_array[] = { 16 - {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 52, 56, 60, 64, 17 - 149, 153, 157, 161, 165}, 24}, 18 - {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 11}, 19 - {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 40, 44, 48, 52, 56, 20 - 60, 64}, 21}, 21 - {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13}, 22 - {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13}, 23 - {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52, 24 - 56, 60, 64}, 22}, 25 - {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52, 26 - 56, 60, 64}, 22}, 27 - {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13}, 28 - {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52, 29 - 56, 60, 64}, 22}, 30 - {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52, 31 - 56, 60, 64}, 22}, 32 - {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, 14}, 33 - {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13}, 34 - {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 40, 44, 48, 52, 35 - 56, 60, 64}, 21} 36 - }; 37 - 38 - void dot11d_init(struct rtllib_device *ieee) 39 - { 40 - struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(ieee); 41 - 42 - dot11d_info->enabled = false; 43 - 44 - dot11d_info->state = DOT11D_STATE_NONE; 45 - dot11d_info->country_len = 0; 46 - memset(dot11d_info->channel_map, 0, MAX_CHANNEL_NUMBER + 1); 47 - memset(dot11d_info->max_tx_power_list, 0xFF, MAX_CHANNEL_NUMBER + 1); 48 - RESET_CIE_WATCHDOG(ieee); 49 - } 50 - EXPORT_SYMBOL(dot11d_init); 51 - 52 - void dot11d_channel_map(u8 channel_plan, struct rtllib_device *ieee) 53 - { 54 - int i, max_chan = 14, min_chan = 1; 55 - 56 - ieee->global_domain = false; 57 - 58 - if (channel_array[channel_plan].len != 0) { 59 - memset(GET_DOT11D_INFO(ieee)->channel_map, 0, 60 - sizeof(GET_DOT11D_INFO(ieee)->channel_map)); 61 - for (i = 0; i < channel_array[channel_plan].len; i++) { 62 - if (channel_array[channel_plan].channel[i] < min_chan || 63 - channel_array[channel_plan].channel[i] > max_chan) 64 - break; 65 - GET_DOT11D_INFO(ieee)->channel_map[channel_array 66 - [channel_plan].channel[i]] = 1; 67 - } 68 - } 69 - 70 - switch (channel_plan) { 71 - case COUNTRY_CODE_GLOBAL_DOMAIN: 72 - ieee->global_domain = true; 73 - for (i = 12; i <= 14; i++) 74 - GET_DOT11D_INFO(ieee)->channel_map[i] = 2; 75 - ieee->bss_start_channel = 10; 76 - break; 77 - 78 - case COUNTRY_CODE_WORLD_WIDE_13: 79 - for (i = 12; i <= 13; i++) 80 - GET_DOT11D_INFO(ieee)->channel_map[i] = 2; 81 - ieee->bss_start_channel = 10; 82 - break; 83 - 84 - default: 85 - ieee->bss_start_channel = 1; 86 - break; 87 - } 88 - } 89 - EXPORT_SYMBOL(dot11d_channel_map); 90 - 91 - void dot11d_reset(struct rtllib_device *ieee) 92 - { 93 - struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(ieee); 94 - u32 i; 95 - 96 - memset(dot11d_info->channel_map, 0, MAX_CHANNEL_NUMBER + 1); 97 - memset(dot11d_info->max_tx_power_list, 0xFF, MAX_CHANNEL_NUMBER + 1); 98 - for (i = 1; i <= 11; i++) 99 - (dot11d_info->channel_map)[i] = 1; 100 - for (i = 12; i <= 14; i++) 101 - (dot11d_info->channel_map)[i] = 2; 102 - dot11d_info->state = DOT11D_STATE_NONE; 103 - dot11d_info->country_len = 0; 104 - RESET_CIE_WATCHDOG(ieee); 105 - } 106 - 107 - void dot11d_update_country(struct rtllib_device *dev, u8 *address, 108 - u16 country_len, u8 *country) 109 - { 110 - struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(dev); 111 - u8 i, j, number_of_triples, max_channel_number; 112 - struct chnl_txpow_triple *triple; 113 - 114 - memset(dot11d_info->channel_map, 0, MAX_CHANNEL_NUMBER + 1); 115 - memset(dot11d_info->max_tx_power_list, 0xFF, MAX_CHANNEL_NUMBER + 1); 116 - max_channel_number = 0; 117 - number_of_triples = (country_len - 3) / 3; 118 - triple = (struct chnl_txpow_triple *)(country + 3); 119 - for (i = 0; i < number_of_triples; i++) { 120 - if (max_channel_number >= triple->first_channel) { 121 - netdev_info(dev->dev, 122 - "%s: Invalid country IE, skip it......1\n", 123 - __func__); 124 - return; 125 - } 126 - if (MAX_CHANNEL_NUMBER < (triple->first_channel + 127 - triple->num_channels)) { 128 - netdev_info(dev->dev, 129 - "%s: Invalid country IE, skip it......2\n", 130 - __func__); 131 - return; 132 - } 133 - 134 - for (j = 0; j < triple->num_channels; j++) { 135 - dot11d_info->channel_map[triple->first_channel + j] = 1; 136 - dot11d_info->max_tx_power_list[triple->first_channel + j] = 137 - triple->max_tx_power; 138 - max_channel_number = triple->first_channel + j; 139 - } 140 - 141 - triple = (struct chnl_txpow_triple *)((u8 *)triple + 3); 142 - } 143 - 144 - UPDATE_CIE_SRC(dev, address); 145 - 146 - dot11d_info->country_len = country_len; 147 - memcpy(dot11d_info->country_buffer, country, country_len); 148 - dot11d_info->state = DOT11D_STATE_LEARNED; 149 - } 150 - 151 - void dot11d_scan_complete(struct rtllib_device *dev) 152 - { 153 - struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(dev); 154 - 155 - switch (dot11d_info->state) { 156 - case DOT11D_STATE_LEARNED: 157 - dot11d_info->state = DOT11D_STATE_DONE; 158 - break; 159 - case DOT11D_STATE_DONE: 160 - dot11d_reset(dev); 161 - break; 162 - case DOT11D_STATE_NONE: 163 - break; 164 - } 165 - }
-84
drivers/staging/rtl8192e/dot11d.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - /****************************************************************************** 3 - * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved. 4 - * 5 - * Contact Information: 6 - * wlanfae <wlanfae@realtek.com> 7 - ******************************************************************************/ 8 - #ifndef __INC_DOT11D_H 9 - #define __INC_DOT11D_H 10 - 11 - #include "rtllib.h" 12 - 13 - struct chnl_txpow_triple { 14 - u8 first_channel; 15 - u8 num_channels; 16 - u8 max_tx_power; 17 - }; 18 - 19 - enum dot11d_state { 20 - DOT11D_STATE_NONE = 0, 21 - DOT11D_STATE_LEARNED, 22 - DOT11D_STATE_DONE, 23 - }; 24 - 25 - /** 26 - * struct rt_dot11d_info * @country_len: value greater than 0 if 27 - * @country_buffer contains valid country information element. 28 - * @channel_map: holds channel values 29 - * 0 - invalid, 30 - * 1 - valid (active scan), 31 - * 2 - valid (passive scan) 32 - * @country_src_addr - Source AP of the country IE 33 - */ 34 - 35 - struct rt_dot11d_info { 36 - bool enabled; 37 - 38 - u16 country_len; 39 - u8 country_buffer[MAX_IE_LEN]; 40 - u8 country_src_addr[6]; 41 - u8 country_watchdog; 42 - 43 - u8 channel_map[MAX_CHANNEL_NUMBER + 1]; 44 - u8 max_tx_power_list[MAX_CHANNEL_NUMBER + 1]; 45 - 46 - enum dot11d_state state; 47 - }; 48 - 49 - static inline void copy_mac_addr(unsigned char *des, unsigned char *src) 50 - { 51 - memcpy(des, src, 6); 52 - } 53 - 54 - #define GET_DOT11D_INFO(__ieee_dev) \ 55 - ((struct rt_dot11d_info *)((__ieee_dev)->dot11d_info)) 56 - 57 - #define IS_DOT11D_ENABLE(__ieee_dev) \ 58 - (GET_DOT11D_INFO(__ieee_dev)->enabled) 59 - #define IS_COUNTRY_IE_VALID(__ieee_dev) \ 60 - (GET_DOT11D_INFO(__ieee_dev)->country_len > 0) 61 - 62 - #define IS_EQUAL_CIE_SRC(__ieee_dev, __address) \ 63 - ether_addr_equal_unaligned( \ 64 - GET_DOT11D_INFO(__ieee_dev)->country_src_addr, __address) 65 - #define UPDATE_CIE_SRC(__ieee_dev, __address) \ 66 - copy_mac_addr(GET_DOT11D_INFO(__ieee_dev)->country_src_addr, __address) 67 - 68 - #define GET_CIE_WATCHDOG(__ieee_dev) \ 69 - (GET_DOT11D_INFO(__ieee_dev)->country_watchdog) 70 - static inline void RESET_CIE_WATCHDOG(struct rtllib_device *__ieee_dev) 71 - { 72 - GET_CIE_WATCHDOG(__ieee_dev) = 0; 73 - } 74 - 75 - #define UPDATE_CIE_WATCHDOG(__ieee_dev) (++GET_CIE_WATCHDOG(__ieee_dev)) 76 - 77 - void dot11d_init(struct rtllib_device *dev); 78 - void dot11d_channel_map(u8 channel_plan, struct rtllib_device *ieee); 79 - void dot11d_reset(struct rtllib_device *dev); 80 - void dot11d_update_country(struct rtllib_device *dev, u8 *address, 81 - u16 country_len, u8 *country); 82 - void dot11d_scan_complete(struct rtllib_device *dev); 83 - 84 - #endif
+2 -2
drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c
··· 63 63 64 64 if (type == DESC_PACKET_TYPE_INIT && 65 65 (!priv->rtllib->check_nic_enough_desc(dev, TXCMD_QUEUE) || 66 - (!skb_queue_empty(&priv->rtllib->skb_waitQ[TXCMD_QUEUE])) || 66 + (!skb_queue_empty(&priv->rtllib->skb_waitq[TXCMD_QUEUE])) || 67 67 (priv->rtllib->queue_stop))) { 68 - skb_queue_tail(&priv->rtllib->skb_waitQ[TXCMD_QUEUE], 68 + skb_queue_tail(&priv->rtllib->skb_waitq[TXCMD_QUEUE], 69 69 skb); 70 70 } else { 71 71 priv->rtllib->softmac_hard_start_xmit(skb, dev);
+12 -29
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
··· 51 51 52 52 case HW_VAR_MEDIA_STATUS: 53 53 { 54 - enum rt_op_mode OpMode = *((enum rt_op_mode *)(val)); 54 + enum rt_op_mode op_mode = *((enum rt_op_mode *)(val)); 55 55 u8 btMsr = rtl92e_readb(dev, MSR); 56 56 57 57 btMsr &= 0xfc; 58 58 59 - switch (OpMode) { 59 + switch (op_mode) { 60 60 case RT_OP_MODE_INFRASTRUCTURE: 61 61 btMsr |= MSR_INFRA; 62 62 break; ··· 261 261 priv->eeprom_customer_id = usValue & 0xff; 262 262 usValue = rtl92e_eeprom_read(dev, 263 263 EEPROM_ICVersion_ChannelPlan >> 1); 264 - priv->eeprom_chnl_plan = usValue & 0xff; 265 264 IC_Version = (usValue & 0xff00) >> 8; 266 265 267 266 ICVer8192 = IC_Version & 0xf; ··· 282 283 priv->eeprom_vid = 0; 283 284 priv->eeprom_did = 0; 284 285 priv->eeprom_customer_id = 0; 285 - priv->eeprom_chnl_plan = 0; 286 286 } 287 287 288 288 if (!priv->autoload_fail_flag) { ··· 385 387 386 388 rtl92e_init_adaptive_rate(dev); 387 389 388 - priv->chnl_plan = priv->eeprom_chnl_plan; 389 - 390 390 switch (priv->eeprom_customer_id) { 391 391 case EEPROM_CID_NetCore: 392 392 priv->customer_id = RT_CID_819X_NETCORE; 393 393 break; 394 394 case EEPROM_CID_TOSHIBA: 395 395 priv->customer_id = RT_CID_TOSHIBA; 396 - if (priv->eeprom_chnl_plan & 0x80) 397 - priv->chnl_plan = priv->eeprom_chnl_plan & 0x7f; 398 - else 399 - priv->chnl_plan = 0x0; 400 396 break; 401 397 } 402 - 403 - if (priv->chnl_plan > CHANNEL_PLAN_LEN - 1) 404 - priv->chnl_plan = 0; 405 - priv->chnl_plan = COUNTRY_CODE_WORLD_WIDE_13; 406 398 407 399 if (priv->eeprom_vid == 0x1186 && priv->eeprom_did == 0x3304) 408 400 priv->rtllib->bSupportRemoteWakeUp = true; ··· 879 891 memset(pTxFwInfo, 0, sizeof(struct tx_fwinfo_8190pci)); 880 892 pTxFwInfo->TxHT = (cb_desc->data_rate & 0x80) ? 1 : 0; 881 893 pTxFwInfo->TxRate = _rtl92e_rate_mgn_to_hw(cb_desc->data_rate); 882 - pTxFwInfo->EnableCPUDur = cb_desc->bTxEnableFwCalcDur; 894 + pTxFwInfo->EnableCPUDur = cb_desc->tx_enable_fw_calc_dur; 883 895 pTxFwInfo->Short = _rtl92e_query_is_short(pTxFwInfo->TxHT, 884 896 pTxFwInfo->TxRate, cb_desc); 885 897 886 - if (cb_desc->bAMPDUEnable) { 898 + if (cb_desc->ampdu_enable) { 887 899 pTxFwInfo->AllowAggregation = 1; 888 900 pTxFwInfo->RxMF = cb_desc->ampdu_factor; 889 901 pTxFwInfo->RxAMD = cb_desc->ampdu_density; ··· 1673 1685 stats->TimeStampLow = pDrvInfo->TSFL; 1674 1686 stats->TimeStampHigh = rtl92e_readl(dev, TSFR + 4); 1675 1687 1676 - rtl92e_update_rx_pkt_timestamp(dev, stats); 1677 - 1678 1688 if ((stats->RxBufShift + stats->RxDrvInfoSize) > 0) 1679 1689 stats->bShift = 1; 1680 1690 ··· 1693 1707 { 1694 1708 struct r8192_priv *priv = rtllib_priv(dev); 1695 1709 int i; 1696 - u8 OpMode; 1710 + u8 op_mode; 1697 1711 u8 u1bTmp; 1698 1712 u32 ulRegRead; 1699 1713 1700 - OpMode = RT_OP_MODE_NO_LINK; 1701 - priv->rtllib->SetHwRegHandler(dev, HW_VAR_MEDIA_STATUS, &OpMode); 1714 + op_mode = RT_OP_MODE_NO_LINK; 1715 + priv->rtllib->SetHwRegHandler(dev, HW_VAR_MEDIA_STATUS, &op_mode); 1702 1716 1703 1717 if (!priv->rtllib->bSupportRemoteWakeUp) { 1704 1718 u1bTmp = 0x0; ··· 1728 1742 } 1729 1743 1730 1744 for (i = 0; i < MAX_QUEUE_SIZE; i++) 1731 - skb_queue_purge(&priv->rtllib->skb_waitQ[i]); 1745 + skb_queue_purge(&priv->rtllib->skb_waitq[i]); 1732 1746 1733 1747 skb_queue_purge(&priv->skb_queue); 1734 1748 } ··· 1753 1767 ratr_value &= 0x00000FF7; 1754 1768 break; 1755 1769 case WIRELESS_MODE_N_24G: 1756 - if (ieee->ht_info->peer_mimo_ps == 0) 1757 - ratr_value &= 0x0007F007; 1758 - else 1759 - ratr_value &= 0x000FF007; 1770 + ratr_value &= 0x000FF007; 1760 1771 break; 1761 1772 default: 1762 1773 break; 1763 1774 } 1764 1775 ratr_value &= 0x0FFFFFFF; 1765 1776 if (ieee->ht_info->cur_tx_bw40mhz && 1766 - ieee->ht_info->bCurShortGI40MHz) 1777 + ieee->ht_info->cur_short_gi_40mhz) 1767 1778 ratr_value |= 0x80000000; 1768 1779 else if (!ieee->ht_info->cur_tx_bw40mhz && 1769 - ieee->ht_info->bCurShortGI20MHz) 1780 + ieee->ht_info->cur_short_gi_20mhz) 1770 1781 ratr_value |= 0x80000000; 1771 1782 rtl92e_writel(dev, RATR0 + rate_index * 4, ratr_value); 1772 1783 rtl92e_writeb(dev, UFWP, 1); ··· 1797 1814 IMR_MGNTDOK | IMR_COMDOK | IMR_HIGHDOK | 1798 1815 IMR_BDOK | IMR_RXCMDOK | IMR_TIMEOUT0 | 1799 1816 IMR_RDU | IMR_RXFOVW | IMR_TXFOVW | 1800 - IMR_BcnInt | IMR_TBDOK | IMR_TBDER); 1817 + IMR_TBDOK | IMR_TBDER); 1801 1818 1802 1819 priv->bfirst_after_down = false; 1803 1820 }
+6 -6
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
··· 671 671 _rtl92e_phy_switch_channel(dev, priv->chan); 672 672 } 673 673 674 - u8 rtl92e_set_channel(struct net_device *dev, u8 channel) 674 + void rtl92e_set_channel(struct net_device *dev, u8 channel) 675 675 { 676 676 struct r8192_priv *priv = rtllib_priv(dev); 677 677 678 678 if (!priv->up) { 679 679 netdev_err(dev, "%s(): Driver is not initialized\n", __func__); 680 - return false; 680 + return; 681 681 } 682 682 if (priv->sw_chnl_in_progress) 683 - return false; 683 + return; 684 684 685 685 switch (priv->rtllib->mode) { 686 686 case WIRELESS_MODE_B: ··· 688 688 netdev_warn(dev, 689 689 "Channel %d not available in 802.11b.\n", 690 690 channel); 691 - return false; 691 + return; 692 692 } 693 693 break; 694 694 case WIRELESS_MODE_G: ··· 697 697 netdev_warn(dev, 698 698 "Channel %d not available in 802.11g.\n", 699 699 channel); 700 - return false; 700 + return; 701 701 } 702 702 break; 703 703 } ··· 714 714 if (priv->up) 715 715 _rtl92e_phy_switch_channel_work_item(dev); 716 716 priv->sw_chnl_in_progress = false; 717 - return true; 717 + return; 718 718 } 719 719 720 720 static void _rtl92e_cck_tx_power_track_bw_switch_tssi(struct net_device *dev)
+1 -1
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
··· 41 41 void rtl92e_set_tx_power(struct net_device *dev, u8 channel); 42 42 u8 rtl92e_config_rf_path(struct net_device *dev, enum rf90_radio_path eRFPath); 43 43 44 - u8 rtl92e_set_channel(struct net_device *dev, u8 channel); 44 + void rtl92e_set_channel(struct net_device *dev, u8 channel); 45 45 void rtl92e_set_bw_mode(struct net_device *dev, 46 46 enum ht_channel_width bandwidth, 47 47 enum ht_extchnl_offset Offset);
+17 -84
drivers/staging/rtl8192e/rtl8192e/rtl_core.c
··· 226 226 netdev_info(dev, "TXTIMEOUT"); 227 227 } 228 228 229 - static void _rtl92e_set_chan(struct net_device *dev, short ch) 230 - { 231 - struct r8192_priv *priv = rtllib_priv(dev); 232 - 233 - priv->chan = ch; 234 - 235 - if (priv->rf_set_chan) 236 - priv->rf_set_chan(dev, priv->chan); 237 - } 238 - 239 229 static void _rtl92e_update_cap(struct net_device *dev, u16 cap) 240 230 { 241 231 struct r8192_priv *priv = rtllib_priv(dev); ··· 287 297 if (ieee->ht_info->current_ht_support) 288 298 HT_update_self_and_peer_setting(ieee, net); 289 299 ieee->ht_info->current_rt2rt_long_slot_time = net->bssht.bd_rt2rt_long_slot_time; 290 - ieee->ht_info->RT2RT_HT_Mode = net->bssht.rt2rt_ht_mode; 291 300 _rtl92e_update_cap(dev, net->capability); 292 301 } 293 302 ··· 413 424 414 425 _rtl92e_qos_assoc_resp(priv, network); 415 426 return 0; 416 - } 417 - 418 - static void _rtl92e_prepare_beacon(struct tasklet_struct *t) 419 - { 420 - struct r8192_priv *priv = from_tasklet(priv, t, 421 - irq_prepare_beacon_tasklet); 422 - struct net_device *dev = priv->rtllib->dev; 423 - struct sk_buff *pskb = NULL, *pnewskb = NULL; 424 - struct cb_desc *tcb_desc = NULL; 425 - struct rtl8192_tx_ring *ring = NULL; 426 - struct tx_desc *pdesc = NULL; 427 - 428 - ring = &priv->tx_ring[BEACON_QUEUE]; 429 - pskb = __skb_dequeue(&ring->queue); 430 - kfree_skb(pskb); 431 - 432 - pnewskb = rtllib_get_beacon(priv->rtllib); 433 - if (!pnewskb) 434 - return; 435 - 436 - tcb_desc = (struct cb_desc *)(pnewskb->cb + 8); 437 - tcb_desc->queue_index = BEACON_QUEUE; 438 - tcb_desc->data_rate = 2; 439 - tcb_desc->ratr_index = 7; 440 - tcb_desc->tx_dis_rate_fallback = 1; 441 - tcb_desc->tx_use_drv_assinged_rate = 1; 442 - skb_push(pnewskb, priv->rtllib->tx_headroom); 443 - 444 - pdesc = &ring->desc[0]; 445 - rtl92e_fill_tx_desc(dev, pdesc, tcb_desc, pnewskb); 446 - __skb_queue_tail(&ring->queue, pnewskb); 447 - pdesc->OWN = 1; 448 427 } 449 428 450 429 void rtl92e_config_rate(struct net_device *dev, u16 *rate_config) ··· 642 685 struct r8192_priv *priv = rtllib_priv(dev); 643 686 644 687 priv->rtllib->softmac_hard_start_xmit = _rtl92e_hard_start_xmit; 645 - priv->rtllib->set_chan = _rtl92e_set_chan; 688 + priv->rtllib->set_chan = rtl92e_set_channel; 646 689 priv->rtllib->link_change = rtl92e_link_change; 647 690 priv->rtllib->softmac_data_hard_start_xmit = _rtl92e_hard_data_xmit; 648 691 priv->rtllib->check_nic_enough_desc = _rtl92e_check_nic_enough_desc; ··· 651 694 priv->rtllib->set_wireless_mode = rtl92e_set_wireless_mode; 652 695 priv->rtllib->leisure_ps_leave = rtl92e_leisure_ps_leave; 653 696 priv->rtllib->set_bw_mode_handler = rtl92e_set_bw_mode; 654 - priv->rf_set_chan = rtl92e_set_channel; 655 697 656 698 priv->rtllib->sta_wake_up = rtl92e_hw_wakeup; 657 699 priv->rtllib->enter_sleep_state = rtl92e_enter_sleep; ··· 723 767 skb_queue_head_init(&priv->skb_queue); 724 768 725 769 for (i = 0; i < MAX_QUEUE_SIZE; i++) 726 - skb_queue_head_init(&priv->rtllib->skb_waitQ[i]); 770 + skb_queue_head_init(&priv->rtllib->skb_waitq[i]); 727 771 } 728 772 729 773 static void _rtl92e_init_priv_lock(struct r8192_priv *priv) ··· 752 796 INIT_DELAYED_WORK(&priv->rtllib->hw_sleep_wq, (void *)rtl92e_hw_sleep_wq); 753 797 tasklet_setup(&priv->irq_rx_tasklet, _rtl92e_irq_rx_tasklet); 754 798 tasklet_setup(&priv->irq_tx_tasklet, _rtl92e_irq_tx_tasklet); 755 - tasklet_setup(&priv->irq_prepare_beacon_tasklet, 756 - _rtl92e_prepare_beacon); 757 799 } 758 800 759 801 static short _rtl92e_get_channel_map(struct net_device *dev) ··· 760 806 761 807 struct r8192_priv *priv = rtllib_priv(dev); 762 808 763 - if (priv->chnl_plan >= COUNTRY_CODE_MAX) { 764 - netdev_info(dev, 765 - "rtl819x_init:Error channel plan! Set to default.\n"); 766 - priv->chnl_plan = COUNTRY_CODE_FCC; 767 - } 768 - dot11d_init(priv->rtllib); 769 - dot11d_channel_map(priv->chnl_plan, priv->rtllib); 770 809 for (i = 1; i <= 11; i++) 771 810 (priv->rtllib->active_channel_map)[i] = 1; 772 811 (priv->rtllib->active_channel_map)[12] = 2; ··· 971 1024 } 972 1025 } 973 1026 if ((ieee->link_state == MAC80211_LINKED) && (ieee->iw_mode == IW_MODE_INFRA)) { 974 - if (ieee->link_detect_info.NumRxOkInPeriod > 100 || 975 - ieee->link_detect_info.NumTxOkInPeriod > 100) 1027 + if (ieee->link_detect_info.num_rx_ok_in_period > 100 || 1028 + ieee->link_detect_info.num_tx_ok_in_period > 100) 976 1029 bBusyTraffic = true; 977 1030 978 - if (ieee->link_detect_info.NumRxOkInPeriod > 4000 || 979 - ieee->link_detect_info.NumTxOkInPeriod > 4000) { 1031 + if (ieee->link_detect_info.num_rx_ok_in_period > 4000 || 1032 + ieee->link_detect_info.num_tx_ok_in_period > 4000) { 980 1033 bHigherBusyTraffic = true; 981 - if (ieee->link_detect_info.NumRxOkInPeriod > 5000) 1034 + if (ieee->link_detect_info.num_rx_ok_in_period > 5000) 982 1035 bHigherBusyRxTraffic = true; 983 1036 else 984 1037 bHigherBusyRxTraffic = false; 985 1038 } 986 1039 987 1040 if (((ieee->link_detect_info.NumRxUnicastOkInPeriod + 988 - ieee->link_detect_info.NumTxOkInPeriod) > 8) || 1041 + ieee->link_detect_info.num_tx_ok_in_period) > 8) || 989 1042 (ieee->link_detect_info.NumRxUnicastOkInPeriod > 2)) 990 1043 bEnterPS = false; 991 1044 else ··· 1003 1056 rtl92e_leisure_ps_leave(dev); 1004 1057 } 1005 1058 1006 - ieee->link_detect_info.NumRxOkInPeriod = 0; 1007 - ieee->link_detect_info.NumTxOkInPeriod = 0; 1059 + ieee->link_detect_info.num_rx_ok_in_period = 0; 1060 + ieee->link_detect_info.num_tx_ok_in_period = 0; 1008 1061 ieee->link_detect_info.NumRxUnicastOkInPeriod = 0; 1009 1062 ieee->link_detect_info.bBusyTraffic = bBusyTraffic; 1010 1063 ··· 1187 1240 tcb_desc->ratr_index = 7; 1188 1241 tcb_desc->tx_dis_rate_fallback = 1; 1189 1242 tcb_desc->tx_use_drv_assinged_rate = 1; 1190 - tcb_desc->bTxEnableFwCalcDur = 1; 1243 + tcb_desc->tx_enable_fw_calc_dur = 1; 1191 1244 skb_push(skb, priv->rtllib->tx_headroom); 1192 1245 ret = _rtl92e_tx(dev, skb); 1193 1246 if (ret != 0) ··· 1431 1484 spin_unlock_irqrestore(&priv->irq_th_lock, flags); 1432 1485 } 1433 1486 1434 - void rtl92e_update_rx_pkt_timestamp(struct net_device *dev, 1435 - struct rtllib_rx_stats *stats) 1436 - { 1437 - struct r8192_priv *priv = rtllib_priv(dev); 1438 - 1439 - if (stats->bIsAMPDU && !stats->bFirstMPDU) 1440 - stats->mac_time = priv->last_rx_desc_tsf; 1441 - else 1442 - priv->last_rx_desc_tsf = stats->mac_time; 1443 - } 1444 - 1445 1487 long rtl92e_translate_to_dbm(struct r8192_priv *priv, u8 signal_strength_index) 1446 1488 { 1447 1489 long signal_power; ··· 1574 1638 1575 1639 for (queue_index = BK_QUEUE; 1576 1640 queue_index < MAX_QUEUE_SIZE; queue_index++) { 1577 - while ((!skb_queue_empty(&ieee->skb_waitQ[queue_index])) && 1641 + while ((!skb_queue_empty(&ieee->skb_waitq[queue_index])) && 1578 1642 (priv->rtllib->check_nic_enough_desc(dev, queue_index) > 0)) { 1579 - skb = skb_dequeue(&ieee->skb_waitQ[queue_index]); 1643 + skb = skb_dequeue(&ieee->skb_waitq[queue_index]); 1580 1644 ieee->softmac_data_hard_start_xmit(skb, dev, 0); 1581 1645 } 1582 1646 } ··· 1763 1827 if (inta & IMR_ROK) 1764 1828 tasklet_schedule(&priv->irq_rx_tasklet); 1765 1829 1766 - if (inta & IMR_BcnInt) 1767 - tasklet_schedule(&priv->irq_prepare_beacon_tasklet); 1768 - 1769 1830 if (inta & IMR_RDU) { 1770 1831 rtl92e_writel(dev, INTA_MASK, 1771 1832 rtl92e_readl(dev, INTA_MASK) & ~IMR_RDU); ··· 1773 1840 tasklet_schedule(&priv->irq_rx_tasklet); 1774 1841 1775 1842 if (inta & IMR_BKDOK) { 1776 - priv->rtllib->link_detect_info.NumTxOkInPeriod++; 1843 + priv->rtllib->link_detect_info.num_tx_ok_in_period++; 1777 1844 _rtl92e_tx_isr(dev, BK_QUEUE); 1778 1845 } 1779 1846 1780 1847 if (inta & IMR_BEDOK) { 1781 - priv->rtllib->link_detect_info.NumTxOkInPeriod++; 1848 + priv->rtllib->link_detect_info.num_tx_ok_in_period++; 1782 1849 _rtl92e_tx_isr(dev, BE_QUEUE); 1783 1850 } 1784 1851 1785 1852 if (inta & IMR_VIDOK) { 1786 - priv->rtllib->link_detect_info.NumTxOkInPeriod++; 1853 + priv->rtllib->link_detect_info.num_tx_ok_in_period++; 1787 1854 _rtl92e_tx_isr(dev, VI_QUEUE); 1788 1855 } 1789 1856 1790 1857 if (inta & IMR_VODOK) { 1791 - priv->rtllib->link_detect_info.NumTxOkInPeriod++; 1858 + priv->rtllib->link_detect_info.num_tx_ok_in_period++; 1792 1859 _rtl92e_tx_isr(dev, VO_QUEUE); 1793 1860 } 1794 1861
-11
drivers/staging/rtl8192e/rtl8192e/rtl_core.h
··· 34 34 35 35 #include "../rtllib.h" 36 36 37 - #include "../dot11d.h" 38 - 39 37 #include "r8192E_firmware.h" 40 38 #include "r8192E_hw.h" 41 39 ··· 217 219 218 220 struct tasklet_struct irq_rx_tasklet; 219 221 struct tasklet_struct irq_tx_tasklet; 220 - struct tasklet_struct irq_prepare_beacon_tasklet; 221 222 222 223 struct mutex wx_mutex; 223 224 struct mutex rf_mutex; ··· 225 228 struct rt_stats stats; 226 229 struct iw_statistics wstats; 227 230 228 - u8 (*rf_set_chan)(struct net_device *dev, u8 ch); 229 - 230 231 struct rx_desc *rx_ring; 231 232 struct sk_buff *rx_buf[MAX_RX_COUNT]; 232 233 dma_addr_t rx_ring_dma; 233 234 unsigned int rx_idx; 234 235 int rxringcount; 235 236 u16 rxbuffersize; 236 - 237 - u64 last_rx_desc_tsf; 238 237 239 238 u32 receive_config; 240 239 u8 retry_data; ··· 279 286 u16 eeprom_vid; 280 287 u16 eeprom_did; 281 288 u8 eeprom_customer_id; 282 - u16 eeprom_chnl_plan; 283 289 284 290 u8 eeprom_tx_pwr_level_cck[14]; 285 291 u8 eeprom_tx_pwr_level_ofdm24g[14]; ··· 304 312 305 313 bool tx_pwr_data_read_from_eeprom; 306 314 307 - u16 chnl_plan; 308 315 u8 hw_rf_off_action; 309 316 310 317 bool rf_change_in_progress; ··· 387 396 void rtl92e_config_rate(struct net_device *dev, u16 *rate_config); 388 397 void rtl92e_irq_disable(struct net_device *dev); 389 398 390 - void rtl92e_update_rx_pkt_timestamp(struct net_device *dev, 391 - struct rtllib_rx_stats *stats); 392 399 long rtl92e_translate_to_dbm(struct r8192_priv *priv, u8 signal_strength_index); 393 400 void rtl92e_update_rx_statistics(struct r8192_priv *priv, 394 401 struct rtllib_rx_stats *pprevious_stats);
+11 -11
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
··· 287 287 288 288 if (priv->rtllib->link_state == MAC80211_LINKED) { 289 289 bshort_gi_enabled = (ht_info->cur_tx_bw40mhz && 290 - ht_info->bCurShortGI40MHz) || 290 + ht_info->cur_short_gi_40mhz) || 291 291 (!ht_info->cur_tx_bw40mhz && 292 - ht_info->bCurShortGI20MHz); 292 + ht_info->cur_short_gi_20mhz); 293 293 294 294 pra->upper_rssi_threshold_ratr = 295 295 (pra->upper_rssi_threshold_ratr & (~BIT(31))) | ··· 1142 1142 if (priv->bis_cur_rdlstate || 1143 1143 !priv->bcurrent_turbo_EDCA) { 1144 1144 rtl92e_writel(dev, EDCAPARA_BE, 1145 - edca_setting_UL[ht_info->IOTPeer]); 1145 + edca_setting_UL[ht_info->iot_peer]); 1146 1146 priv->bis_cur_rdlstate = false; 1147 1147 } 1148 1148 } else { ··· 1150 1150 !priv->bcurrent_turbo_EDCA) { 1151 1151 if (priv->rtllib->mode == WIRELESS_MODE_G) 1152 1152 rtl92e_writel(dev, EDCAPARA_BE, 1153 - edca_setting_DL_GMode[ht_info->IOTPeer]); 1153 + edca_setting_DL_GMode[ht_info->iot_peer]); 1154 1154 else 1155 1155 rtl92e_writel(dev, EDCAPARA_BE, 1156 - edca_setting_DL[ht_info->IOTPeer]); 1156 + edca_setting_DL[ht_info->iot_peer]); 1157 1157 priv->bis_cur_rdlstate = true; 1158 1158 } 1159 1159 } ··· 1164 1164 !priv->bcurrent_turbo_EDCA) { 1165 1165 if (priv->rtllib->mode == WIRELESS_MODE_G) 1166 1166 rtl92e_writel(dev, EDCAPARA_BE, 1167 - edca_setting_DL_GMode[ht_info->IOTPeer]); 1167 + edca_setting_DL_GMode[ht_info->iot_peer]); 1168 1168 else 1169 1169 rtl92e_writel(dev, EDCAPARA_BE, 1170 - edca_setting_DL[ht_info->IOTPeer]); 1170 + edca_setting_DL[ht_info->iot_peer]); 1171 1171 priv->bis_cur_rdlstate = true; 1172 1172 } 1173 1173 } else { 1174 1174 if (priv->bis_cur_rdlstate || 1175 1175 !priv->bcurrent_turbo_EDCA) { 1176 1176 rtl92e_writel(dev, EDCAPARA_BE, 1177 - edca_setting_UL[ht_info->IOTPeer]); 1177 + edca_setting_UL[ht_info->iot_peer]); 1178 1178 priv->bis_cur_rdlstate = false; 1179 1179 } 1180 1180 } ··· 1217 1217 ht_info->iot_action &= ~HT_IOT_ACT_FORCED_CTS2SELF; 1218 1218 return; 1219 1219 } 1220 - if (ht_info->IOTPeer == HT_IOT_PEER_BROADCOM) { 1220 + if (ht_info->iot_peer == HT_IOT_PEER_BROADCOM) { 1221 1221 curTxOkCnt = priv->stats.txbytesunicast - lastTxOkCnt; 1222 1222 curRxOkCnt = priv->stats.rxbytesunicast - lastRxOkCnt; 1223 1223 if (curRxOkCnt > 4 * curTxOkCnt) ··· 1713 1713 static u8 reg_c38_State = RegC38_Default; 1714 1714 1715 1715 if (priv->rtllib->link_state == MAC80211_LINKED && 1716 - priv->rtllib->ht_info->IOTPeer == HT_IOT_PEER_BROADCOM) { 1716 + priv->rtllib->ht_info->iot_peer == HT_IOT_PEER_BROADCOM) { 1717 1717 if (priv->rtllib->bfsync_enable == 0) { 1718 1718 switch (priv->rtllib->fsync_state) { 1719 1719 case Default_Fsync: ··· 1819 1819 priv->dynamic_tx_low_pwr = false; 1820 1820 return; 1821 1821 } 1822 - if ((priv->rtllib->ht_info->IOTPeer == HT_IOT_PEER_ATHEROS) && 1822 + if ((priv->rtllib->ht_info->iot_peer == HT_IOT_PEER_ATHEROS) && 1823 1823 (priv->rtllib->mode == WIRELESS_MODE_G)) { 1824 1824 txhipower_threshold = TX_POWER_ATHEROAP_THRESH_HIGH; 1825 1825 txlowpower_threshold = TX_POWER_ATHEROAP_THRESH_LOW;
-22
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
··· 158 158 return ret; 159 159 } 160 160 161 - struct iw_range_with_scan_capa { 162 - /* Informative stuff (to choose between different interface) */ 163 - __u32 throughput; /* To give an idea... */ 164 - /* In theory this value should be the maximum benchmarked 165 - * TCP/IP throughput, because with most of these devices the 166 - * bit rate is meaningless (overhead an co) to estimate how 167 - * fast the connection will go and pick the fastest one. 168 - * I suggest people to play with Netperf or any benchmark... 169 - */ 170 - 171 - /* NWID (or domain id) */ 172 - __u32 min_nwid; /* Minimal NWID we are able to set */ 173 - __u32 max_nwid; /* Maximal NWID we are able to set */ 174 - 175 - /* Old Frequency (backward compat - moved lower ) */ 176 - __u16 old_num_channels; 177 - __u8 old_num_frequency; 178 - 179 - /* Scan capabilities */ 180 - __u8 scan_capa; 181 - }; 182 - 183 161 static int _rtl92e_wx_get_range(struct net_device *dev, 184 162 struct iw_request_info *info, 185 163 union iwreq_data *wrqu, char *extra)
+113 -113
drivers/staging/rtl8192e/rtl819x_BAProc.c
··· 23 23 del_timer_sync(&ba->timer); 24 24 } 25 25 26 - static u8 tx_ts_delete_ba(struct rtllib_device *ieee, struct tx_ts_record *pTxTs) 26 + static u8 tx_ts_delete_ba(struct rtllib_device *ieee, struct tx_ts_record *ts) 27 27 { 28 - struct ba_record *admitted_ba = &pTxTs->TxAdmittedBARecord; 29 - struct ba_record *pending_ba = &pTxTs->TxPendingBARecord; 30 - u8 bSendDELBA = false; 28 + struct ba_record *admitted_ba = &ts->tx_admitted_ba_record; 29 + struct ba_record *pending_ba = &ts->tx_pending_ba_record; 30 + u8 send_del_ba = false; 31 31 32 32 if (pending_ba->b_valid) { 33 33 deactivate_ba_entry(ieee, pending_ba); 34 - bSendDELBA = true; 34 + send_del_ba = true; 35 35 } 36 36 37 37 if (admitted_ba->b_valid) { 38 38 deactivate_ba_entry(ieee, admitted_ba); 39 - bSendDELBA = true; 39 + send_del_ba = true; 40 40 } 41 - return bSendDELBA; 41 + return send_del_ba; 42 42 } 43 43 44 44 static u8 rx_ts_delete_ba(struct rtllib_device *ieee, struct rx_ts_record *ts) 45 45 { 46 46 struct ba_record *ba = &ts->rx_admitted_ba_record; 47 - u8 bSendDELBA = false; 47 + u8 send_del_ba = false; 48 48 49 49 if (ba->b_valid) { 50 50 deactivate_ba_entry(ieee, ba); 51 - bSendDELBA = true; 51 + send_del_ba = true; 52 52 } 53 53 54 - return bSendDELBA; 54 + return send_del_ba; 55 55 } 56 56 57 57 void rtllib_reset_ba_entry(struct ba_record *ba) ··· 68 68 u16 status_code, u8 type) 69 69 { 70 70 struct sk_buff *skb = NULL; 71 - struct ieee80211_hdr_3addr *BAReq = NULL; 71 + struct ieee80211_hdr_3addr *ba_req = NULL; 72 72 u8 *tag = NULL; 73 73 u16 len = ieee->tx_headroom + 9; 74 74 ··· 87 87 88 88 skb_reserve(skb, ieee->tx_headroom); 89 89 90 - BAReq = skb_put(skb, sizeof(struct ieee80211_hdr_3addr)); 90 + ba_req = skb_put(skb, sizeof(struct ieee80211_hdr_3addr)); 91 91 92 - ether_addr_copy(BAReq->addr1, dst); 93 - ether_addr_copy(BAReq->addr2, ieee->dev->dev_addr); 92 + ether_addr_copy(ba_req->addr1, dst); 93 + ether_addr_copy(ba_req->addr2, ieee->dev->dev_addr); 94 94 95 - ether_addr_copy(BAReq->addr3, ieee->current_network.bssid); 96 - BAReq->frame_control = cpu_to_le16(IEEE80211_STYPE_ACTION); 95 + ether_addr_copy(ba_req->addr3, ieee->current_network.bssid); 96 + ba_req->frame_control = cpu_to_le16(IEEE80211_STYPE_ACTION); 97 97 98 98 tag = skb_put(skb, 9); 99 99 *tag++ = ACT_CAT_BA; ··· 127 127 struct ba_record *ba, 128 128 enum tr_select TxRxSelect, u16 reason_code) 129 129 { 130 - union delba_param_set DelbaParamSet; 130 + union delba_param_set del_ba_param_set; 131 131 struct sk_buff *skb = NULL; 132 - struct ieee80211_hdr_3addr *Delba = NULL; 132 + struct ieee80211_hdr_3addr *del_ba = NULL; 133 133 u8 *tag = NULL; 134 134 u16 len = 6 + ieee->tx_headroom; 135 135 ··· 137 137 netdev_dbg(ieee->dev, "%s(): reason_code(%d) sentd to: %pM\n", 138 138 __func__, reason_code, dst); 139 139 140 - memset(&DelbaParamSet, 0, 2); 140 + memset(&del_ba_param_set, 0, 2); 141 141 142 - DelbaParamSet.field.initiator = (TxRxSelect == TX_DIR) ? 1 : 0; 143 - DelbaParamSet.field.tid = ba->ba_param_set.field.tid; 142 + del_ba_param_set.field.initiator = (TxRxSelect == TX_DIR) ? 1 : 0; 143 + del_ba_param_set.field.tid = ba->ba_param_set.field.tid; 144 144 145 145 skb = dev_alloc_skb(len + sizeof(struct ieee80211_hdr_3addr)); 146 146 if (!skb) ··· 148 148 149 149 skb_reserve(skb, ieee->tx_headroom); 150 150 151 - Delba = skb_put(skb, sizeof(struct ieee80211_hdr_3addr)); 151 + del_ba = skb_put(skb, sizeof(struct ieee80211_hdr_3addr)); 152 152 153 - ether_addr_copy(Delba->addr1, dst); 154 - ether_addr_copy(Delba->addr2, ieee->dev->dev_addr); 155 - ether_addr_copy(Delba->addr3, ieee->current_network.bssid); 156 - Delba->frame_control = cpu_to_le16(IEEE80211_STYPE_ACTION); 153 + ether_addr_copy(del_ba->addr1, dst); 154 + ether_addr_copy(del_ba->addr2, ieee->dev->dev_addr); 155 + ether_addr_copy(del_ba->addr3, ieee->current_network.bssid); 156 + del_ba->frame_control = cpu_to_le16(IEEE80211_STYPE_ACTION); 157 157 158 158 tag = skb_put(skb, 6); 159 159 160 160 *tag++ = ACT_CAT_BA; 161 161 *tag++ = ACT_DELBA; 162 162 163 - put_unaligned_le16(DelbaParamSet.short_data, tag); 163 + put_unaligned_le16(del_ba_param_set.short_data, tag); 164 164 tag += 2; 165 165 166 166 put_unaligned_le16(reason_code, tag); ··· 215 215 { 216 216 struct ieee80211_hdr_3addr *req = NULL; 217 217 u16 rc = 0; 218 - u8 *dst = NULL, *pDialogToken = NULL, *tag = NULL; 218 + u8 *dst = NULL, *dialog_token = NULL, *tag = NULL; 219 219 struct ba_record *ba = NULL; 220 - union ba_param_set *pBaParamSet = NULL; 221 - u16 *pBaTimeoutVal = NULL; 222 - union sequence_control *pBaStartSeqCtrl = NULL; 220 + union ba_param_set *ba_param_set = NULL; 221 + u16 *ba_timeout_value = NULL; 222 + union sequence_control *ba_start_seq_ctrl = NULL; 223 223 struct rx_ts_record *ts = NULL; 224 224 225 225 if (skb->len < sizeof(struct ieee80211_hdr_3addr) + 9) { ··· 238 238 tag = (u8 *)req; 239 239 dst = (u8 *)(&req->addr2[0]); 240 240 tag += sizeof(struct ieee80211_hdr_3addr); 241 - pDialogToken = tag + 2; 242 - pBaParamSet = (union ba_param_set *)(tag + 3); 243 - pBaTimeoutVal = (u16 *)(tag + 5); 244 - pBaStartSeqCtrl = (union sequence_control *)(req + 7); 241 + dialog_token = tag + 2; 242 + ba_param_set = (union ba_param_set *)(tag + 3); 243 + ba_timeout_value = (u16 *)(tag + 5); 244 + ba_start_seq_ctrl = (union sequence_control *)(req + 7); 245 245 246 246 if (!ieee->current_network.qos_data.active || 247 247 !ieee->ht_info->current_ht_support || ··· 254 254 goto OnADDBAReq_Fail; 255 255 } 256 256 if (!rtllib_get_ts(ieee, (struct ts_common_info **)&ts, dst, 257 - (u8)(pBaParamSet->field.tid), RX_DIR, true)) { 257 + (u8)(ba_param_set->field.tid), RX_DIR, true)) { 258 258 rc = ADDBA_STATUS_REFUSED; 259 259 netdev_warn(ieee->dev, "%s(): can't get TS\n", __func__); 260 260 goto OnADDBAReq_Fail; 261 261 } 262 262 ba = &ts->rx_admitted_ba_record; 263 263 264 - if (pBaParamSet->field.ba_policy == BA_POLICY_DELAYED) { 264 + if (ba_param_set->field.ba_policy == BA_POLICY_DELAYED) { 265 265 rc = ADDBA_STATUS_INVALID_PARAM; 266 266 netdev_warn(ieee->dev, "%s(): BA Policy is not correct\n", 267 267 __func__); ··· 271 271 rtllib_FlushRxTsPendingPkts(ieee, ts); 272 272 273 273 deactivate_ba_entry(ieee, ba); 274 - ba->dialog_token = *pDialogToken; 275 - ba->ba_param_set = *pBaParamSet; 276 - ba->ba_timeout_value = *pBaTimeoutVal; 277 - ba->ba_start_seq_ctrl = *pBaStartSeqCtrl; 274 + ba->dialog_token = *dialog_token; 275 + ba->ba_param_set = *ba_param_set; 276 + ba->ba_timeout_value = *ba_timeout_value; 277 + ba->ba_start_seq_ctrl = *ba_start_seq_ctrl; 278 278 279 279 if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev) || 280 280 (ieee->ht_info->iot_action & HT_IOT_ACT_ALLOW_PEER_AGG_ONE_PKT)) ··· 291 291 { 292 292 struct ba_record BA; 293 293 294 - BA.ba_param_set = *pBaParamSet; 295 - BA.ba_timeout_value = *pBaTimeoutVal; 296 - BA.dialog_token = *pDialogToken; 294 + BA.ba_param_set = *ba_param_set; 295 + BA.ba_timeout_value = *ba_timeout_value; 296 + BA.dialog_token = *dialog_token; 297 297 BA.ba_param_set.field.ba_policy = BA_POLICY_IMMEDIATE; 298 298 rtllib_send_ADDBARsp(ieee, dst, &BA, rc); 299 299 return 0; ··· 303 303 int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb) 304 304 { 305 305 struct ieee80211_hdr_3addr *rsp = NULL; 306 - struct ba_record *pending_ba, *pAdmittedBA; 306 + struct ba_record *pending_ba, *admitted_ba; 307 307 struct tx_ts_record *ts = NULL; 308 - u8 *dst = NULL, *pDialogToken = NULL, *tag = NULL; 309 - u16 *status_code = NULL, *pBaTimeoutVal = NULL; 310 - union ba_param_set *pBaParamSet = NULL; 308 + u8 *dst = NULL, *dialog_token = NULL, *tag = NULL; 309 + u16 *status_code = NULL, *ba_timeout_value = NULL; 310 + union ba_param_set *ba_param_set = NULL; 311 311 u16 reason_code; 312 312 313 313 if (skb->len < sizeof(struct ieee80211_hdr_3addr) + 9) { ··· 320 320 tag = (u8 *)rsp; 321 321 dst = (u8 *)(&rsp->addr2[0]); 322 322 tag += sizeof(struct ieee80211_hdr_3addr); 323 - pDialogToken = tag + 2; 323 + dialog_token = tag + 2; 324 324 status_code = (u16 *)(tag + 3); 325 - pBaParamSet = (union ba_param_set *)(tag + 5); 326 - pBaTimeoutVal = (u16 *)(tag + 7); 325 + ba_param_set = (union ba_param_set *)(tag + 5); 326 + ba_timeout_value = (u16 *)(tag + 7); 327 327 328 328 if (!ieee->current_network.qos_data.active || 329 329 !ieee->ht_info->current_ht_support || 330 - !ieee->ht_info->bCurrentAMPDUEnable) { 330 + !ieee->ht_info->current_ampdu_enable) { 331 331 netdev_warn(ieee->dev, 332 332 "reject to ADDBA_RSP as some capability is not ready(%d, %d, %d)\n", 333 333 ieee->current_network.qos_data.active, 334 334 ieee->ht_info->current_ht_support, 335 - ieee->ht_info->bCurrentAMPDUEnable); 335 + ieee->ht_info->current_ampdu_enable); 336 336 reason_code = DELBA_REASON_UNKNOWN_BA; 337 337 goto OnADDBARsp_Reject; 338 338 } 339 339 340 340 if (!rtllib_get_ts(ieee, (struct ts_common_info **)&ts, dst, 341 - (u8)(pBaParamSet->field.tid), TX_DIR, false)) { 341 + (u8)(ba_param_set->field.tid), TX_DIR, false)) { 342 342 netdev_warn(ieee->dev, "%s(): can't get TS\n", __func__); 343 343 reason_code = DELBA_REASON_UNKNOWN_BA; 344 344 goto OnADDBARsp_Reject; 345 345 } 346 346 347 - ts->bAddBaReqInProgress = false; 348 - pending_ba = &ts->TxPendingBARecord; 349 - pAdmittedBA = &ts->TxAdmittedBARecord; 347 + ts->add_ba_req_in_progress = false; 348 + pending_ba = &ts->tx_pending_ba_record; 349 + admitted_ba = &ts->tx_admitted_ba_record; 350 350 351 - if (pAdmittedBA->b_valid) { 351 + if (admitted_ba->b_valid) { 352 352 netdev_dbg(ieee->dev, "%s(): ADDBA response already admitted\n", 353 353 __func__); 354 354 return -1; 355 355 } else if (!pending_ba->b_valid || 356 - (*pDialogToken != pending_ba->dialog_token)) { 356 + (*dialog_token != pending_ba->dialog_token)) { 357 357 netdev_warn(ieee->dev, 358 358 "%s(): ADDBA Rsp. BA invalid, DELBA!\n", 359 359 __func__); ··· 367 367 } 368 368 369 369 if (*status_code == ADDBA_STATUS_SUCCESS) { 370 - if (pBaParamSet->field.ba_policy == BA_POLICY_DELAYED) { 371 - ts->bAddBaReqDelayed = true; 372 - deactivate_ba_entry(ieee, pAdmittedBA); 370 + if (ba_param_set->field.ba_policy == BA_POLICY_DELAYED) { 371 + ts->add_ba_req_delayed = true; 372 + deactivate_ba_entry(ieee, admitted_ba); 373 373 reason_code = DELBA_REASON_END_BA; 374 374 goto OnADDBARsp_Reject; 375 375 } 376 376 377 - pAdmittedBA->dialog_token = *pDialogToken; 378 - pAdmittedBA->ba_timeout_value = *pBaTimeoutVal; 379 - pAdmittedBA->ba_start_seq_ctrl = pending_ba->ba_start_seq_ctrl; 380 - pAdmittedBA->ba_param_set = *pBaParamSet; 381 - deactivate_ba_entry(ieee, pAdmittedBA); 382 - activate_ba_entry(pAdmittedBA, *pBaTimeoutVal); 377 + admitted_ba->dialog_token = *dialog_token; 378 + admitted_ba->ba_timeout_value = *ba_timeout_value; 379 + admitted_ba->ba_start_seq_ctrl = pending_ba->ba_start_seq_ctrl; 380 + admitted_ba->ba_param_set = *ba_param_set; 381 + deactivate_ba_entry(ieee, admitted_ba); 382 + activate_ba_entry(admitted_ba, *ba_timeout_value); 383 383 } else { 384 - ts->bAddBaReqDelayed = true; 385 - ts->bDisable_AddBa = true; 384 + ts->add_ba_req_delayed = true; 385 + ts->disable_add_ba = true; 386 386 reason_code = DELBA_REASON_END_BA; 387 387 goto OnADDBARsp_Reject; 388 388 } ··· 393 393 { 394 394 struct ba_record BA; 395 395 396 - BA.ba_param_set = *pBaParamSet; 396 + BA.ba_param_set = *ba_param_set; 397 397 rtllib_send_DELBA(ieee, dst, &BA, TX_DIR, reason_code); 398 398 return 0; 399 399 } ··· 402 402 int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb) 403 403 { 404 404 struct ieee80211_hdr_3addr *delba = NULL; 405 - union delba_param_set *pDelBaParamSet = NULL; 405 + union delba_param_set *del_ba_param_set = NULL; 406 406 u8 *dst = NULL; 407 407 408 408 if (skb->len < sizeof(struct ieee80211_hdr_3addr) + 6) { ··· 427 427 #endif 428 428 delba = (struct ieee80211_hdr_3addr *)skb->data; 429 429 dst = (u8 *)(&delba->addr2[0]); 430 - pDelBaParamSet = (union delba_param_set *)&delba->seq_ctrl + 2; 430 + del_ba_param_set = (union delba_param_set *)&delba->seq_ctrl + 2; 431 431 432 - if (pDelBaParamSet->field.initiator == 1) { 432 + if (del_ba_param_set->field.initiator == 1) { 433 433 struct rx_ts_record *ts; 434 434 435 435 if (!rtllib_get_ts(ieee, (struct ts_common_info **)&ts, dst, 436 - (u8)pDelBaParamSet->field.tid, RX_DIR, false)) { 436 + (u8)del_ba_param_set->field.tid, RX_DIR, false)) { 437 437 netdev_warn(ieee->dev, 438 438 "%s(): can't get TS for RXTS. dst:%pM TID:%d\n", 439 439 __func__, dst, 440 - (u8)pDelBaParamSet->field.tid); 440 + (u8)del_ba_param_set->field.tid); 441 441 return -1; 442 442 } 443 443 444 444 rx_ts_delete_ba(ieee, ts); 445 445 } else { 446 - struct tx_ts_record *pTxTs; 446 + struct tx_ts_record *ts; 447 447 448 - if (!rtllib_get_ts(ieee, (struct ts_common_info **)&pTxTs, dst, 449 - (u8)pDelBaParamSet->field.tid, TX_DIR, false)) { 448 + if (!rtllib_get_ts(ieee, (struct ts_common_info **)&ts, dst, 449 + (u8)del_ba_param_set->field.tid, TX_DIR, false)) { 450 450 netdev_warn(ieee->dev, "%s(): can't get TS for TXTS\n", 451 451 __func__); 452 452 return -1; 453 453 } 454 454 455 - pTxTs->bUsingBa = false; 456 - pTxTs->bAddBaReqInProgress = false; 457 - pTxTs->bAddBaReqDelayed = false; 458 - del_timer_sync(&pTxTs->TsAddBaTimer); 459 - tx_ts_delete_ba(ieee, pTxTs); 455 + ts->using_ba = false; 456 + ts->add_ba_req_in_progress = false; 457 + ts->add_ba_req_delayed = false; 458 + del_timer_sync(&ts->ts_add_ba_timer); 459 + tx_ts_delete_ba(ieee, ts); 460 460 } 461 461 return 0; 462 462 } 463 463 464 464 void rtllib_ts_init_add_ba(struct rtllib_device *ieee, struct tx_ts_record *ts, 465 - u8 policy, u8 bOverwritePending) 465 + u8 policy, u8 overwrite_pending) 466 466 { 467 - struct ba_record *ba = &ts->TxPendingBARecord; 467 + struct ba_record *ba = &ts->tx_pending_ba_record; 468 468 469 - if (ba->b_valid && !bOverwritePending) 469 + if (ba->b_valid && !overwrite_pending) 470 470 return; 471 471 472 472 deactivate_ba_entry(ieee, ba); ··· 474 474 ba->dialog_token++; 475 475 ba->ba_param_set.field.amsdu_support = 0; 476 476 ba->ba_param_set.field.ba_policy = policy; 477 - ba->ba_param_set.field.tid = ts->TsCommonInfo.TSpec.ucTSID; 477 + ba->ba_param_set.field.tid = ts->ts_common_info.tspec.ts_id; 478 478 ba->ba_param_set.field.buffer_size = 32; 479 479 ba->ba_timeout_value = 0; 480 - ba->ba_start_seq_ctrl.field.seq_num = (ts->TxCurSeq + 3) % 4096; 480 + ba->ba_start_seq_ctrl.field.seq_num = (ts->tx_cur_seq + 3) % 4096; 481 481 482 482 activate_ba_entry(ba, BA_SETUP_TIMEOUT); 483 483 484 - rtllib_send_ADDBAReq(ieee, ts->TsCommonInfo.addr, ba); 484 + rtllib_send_ADDBAReq(ieee, ts->ts_common_info.addr, ba); 485 485 } 486 486 487 487 void rtllib_ts_init_del_ba(struct rtllib_device *ieee, 488 - struct ts_common_info *pTsCommonInfo, 488 + struct ts_common_info *ts_common_info, 489 489 enum tr_select TxRxSelect) 490 490 { 491 491 if (TxRxSelect == TX_DIR) { 492 - struct tx_ts_record *pTxTs = 493 - (struct tx_ts_record *)pTsCommonInfo; 492 + struct tx_ts_record *ts = 493 + (struct tx_ts_record *)ts_common_info; 494 494 495 - if (tx_ts_delete_ba(ieee, pTxTs)) 496 - rtllib_send_DELBA(ieee, pTsCommonInfo->addr, 497 - (pTxTs->TxAdmittedBARecord.b_valid) ? 498 - (&pTxTs->TxAdmittedBARecord) : 499 - (&pTxTs->TxPendingBARecord), 495 + if (tx_ts_delete_ba(ieee, ts)) 496 + rtllib_send_DELBA(ieee, ts_common_info->addr, 497 + (ts->tx_admitted_ba_record.b_valid) ? 498 + (&ts->tx_admitted_ba_record) : 499 + (&ts->tx_pending_ba_record), 500 500 TxRxSelect, DELBA_REASON_END_BA); 501 501 } else if (TxRxSelect == RX_DIR) { 502 502 struct rx_ts_record *ts = 503 - (struct rx_ts_record *)pTsCommonInfo; 503 + (struct rx_ts_record *)ts_common_info; 504 504 if (rx_ts_delete_ba(ieee, ts)) 505 - rtllib_send_DELBA(ieee, pTsCommonInfo->addr, 505 + rtllib_send_DELBA(ieee, ts_common_info->addr, 506 506 &ts->rx_admitted_ba_record, 507 507 TxRxSelect, DELBA_REASON_END_BA); 508 508 } ··· 510 510 511 511 void rtllib_ba_setup_timeout(struct timer_list *t) 512 512 { 513 - struct tx_ts_record *pTxTs = from_timer(pTxTs, t, 514 - TxPendingBARecord.timer); 513 + struct tx_ts_record *ts = from_timer(ts, t, 514 + tx_pending_ba_record.timer); 515 515 516 - pTxTs->bAddBaReqInProgress = false; 517 - pTxTs->bAddBaReqDelayed = true; 518 - pTxTs->TxPendingBARecord.b_valid = false; 516 + ts->add_ba_req_in_progress = false; 517 + ts->add_ba_req_delayed = true; 518 + ts->tx_pending_ba_record.b_valid = false; 519 519 } 520 520 521 521 void rtllib_tx_ba_inact_timeout(struct timer_list *t) 522 522 { 523 - struct tx_ts_record *pTxTs = from_timer(pTxTs, t, 524 - TxAdmittedBARecord.timer); 525 - struct rtllib_device *ieee = container_of(pTxTs, struct rtllib_device, 526 - TxTsRecord[pTxTs->num]); 527 - tx_ts_delete_ba(ieee, pTxTs); 528 - rtllib_send_DELBA(ieee, pTxTs->TsCommonInfo.addr, 529 - &pTxTs->TxAdmittedBARecord, TX_DIR, 523 + struct tx_ts_record *ts = from_timer(ts, t, 524 + tx_admitted_ba_record.timer); 525 + struct rtllib_device *ieee = container_of(ts, struct rtllib_device, 526 + tx_ts_records[ts->num]); 527 + tx_ts_delete_ba(ieee, ts); 528 + rtllib_send_DELBA(ieee, ts->ts_common_info.addr, 529 + &ts->tx_admitted_ba_record, TX_DIR, 530 530 DELBA_REASON_TIMEOUT); 531 531 } 532 532 ··· 535 535 struct rx_ts_record *ts = from_timer(ts, t, 536 536 rx_admitted_ba_record.timer); 537 537 struct rtllib_device *ieee = container_of(ts, struct rtllib_device, 538 - RxTsRecord[ts->num]); 538 + rx_ts_records[ts->num]); 539 539 540 540 rx_ts_delete_ba(ieee, ts); 541 541 rtllib_send_DELBA(ieee, ts->ts_common_info.addr,
+8 -27
drivers/staging/rtl8192e/rtl819x_HT.h
··· 94 94 struct rt_hi_throughput { 95 95 u8 enable_ht; 96 96 u8 current_ht_support; 97 - u8 bRegBW40MHz; 98 - u8 bCurBW40MHz; 99 - u8 bRegShortGI40MHz; 100 - u8 bCurShortGI40MHz; 101 - u8 bRegShortGI20MHz; 102 - u8 bCurShortGI20MHz; 103 - u8 bRegSuppCCK; 104 - u8 bCurSuppCCK; 105 - enum ht_spec_ver ePeerHTSpecVer; 97 + u8 cur_bw_40mhz; 98 + u8 cur_short_gi_40mhz; 99 + u8 cur_short_gi_20mhz; 100 + enum ht_spec_ver peer_ht_spec_ver; 106 101 struct ht_capab_ele SelfHTCap; 107 - struct ht_info_ele SelfHTInfo; 108 102 u8 PeerHTCapBuf[32]; 109 103 u8 PeerHTInfoBuf[32]; 110 - u8 bAMSDU_Support; 111 - u16 nAMSDU_MaxSize; 112 - u8 bCurrent_AMSDU_Support; 113 - u16 nCurrent_AMSDU_MaxSize; 114 - u8 bAMPDUEnable; 115 - u8 bCurrentAMPDUEnable; 116 - u8 AMPDU_Factor; 104 + u8 ampdu_enable; 105 + u8 current_ampdu_enable; 106 + u8 ampdu_factor; 117 107 u8 CurrentAMPDUFactor; 118 - u8 MPDU_Density; 119 108 u8 current_mpdu_density; 120 - enum ht_aggre_mode ForcedAMPDUMode; 121 109 u8 forced_ampdu_factor; 122 110 u8 forced_mpdu_density; 123 - enum ht_aggre_mode ForcedAMSDUMode; 124 - u8 forced_short_gi; 125 111 u8 current_op_mode; 126 - u8 self_mimo_ps; 127 - u8 peer_mimo_ps; 128 112 enum ht_extchnl_offset CurSTAExtChnlOffset; 129 113 u8 cur_tx_bw40mhz; 130 114 u8 sw_bw_in_progress; 131 - u8 reg_rt2rt_aggregation; 132 - u8 RT2RT_HT_Mode; 133 115 u8 current_rt2rt_aggregation; 134 116 u8 current_rt2rt_long_slot_time; 135 117 u8 sz_rt2rt_agg_buf[10]; 136 - u8 reg_rx_reorder_enable; 137 118 u8 cur_rx_reorder_enable; 138 119 u8 rx_reorder_win_size; 139 120 u8 rx_reorder_pending_time; 140 121 u16 rx_reorder_drop_counter; 141 - u8 IOTPeer; 122 + u8 iot_peer; 142 123 u32 iot_action; 143 124 u8 iot_ra_func; 144 125 } __packed;
+142 -229
drivers/staging/rtl8192e/rtl819x_HTProc.c
··· 71 71 { 72 72 struct rt_hi_throughput *ht_info = ieee->ht_info; 73 73 74 - ht_info->bRegShortGI20MHz = 1; 75 - ht_info->bRegShortGI40MHz = 1; 74 + ht_info->ampdu_enable = 1; 75 + ht_info->ampdu_factor = 2; 76 76 77 - ht_info->bRegBW40MHz = 1; 78 - 79 - if (ht_info->bRegBW40MHz) 80 - ht_info->bRegSuppCCK = 1; 81 - else 82 - ht_info->bRegSuppCCK = true; 83 - 84 - ht_info->nAMSDU_MaxSize = 7935UL; 85 - ht_info->bAMSDU_Support = 0; 86 - 87 - ht_info->bAMPDUEnable = 1; 88 - ht_info->AMPDU_Factor = 2; 89 - ht_info->MPDU_Density = 0; 90 - 91 - ht_info->self_mimo_ps = 3; 92 - if (ht_info->self_mimo_ps == 2) 93 - ht_info->self_mimo_ps = 3; 94 77 ieee->tx_dis_rate_fallback = 0; 95 78 ieee->tx_use_drv_assinged_rate = 0; 96 79 97 - ieee->bTxEnableFwCalcDur = 1; 80 + ieee->tx_enable_fw_calc_dur = 1; 98 81 99 - ht_info->reg_rt2rt_aggregation = 1; 100 - 101 - ht_info->reg_rx_reorder_enable = 1; 102 82 ht_info->rx_reorder_win_size = 64; 103 83 ht_info->rx_reorder_pending_time = 30; 104 84 } 105 85 106 - static u16 HTMcsToDataRate(struct rtllib_device *ieee, u8 nMcsRate) 86 + static u16 ht_mcs_to_data_rate(struct rtllib_device *ieee, u8 mcs_rate) 107 87 { 108 88 struct rt_hi_throughput *ht_info = ieee->ht_info; 109 89 110 - u8 is40MHz = (ht_info->bCurBW40MHz) ? 1 : 0; 111 - u8 isShortGI = (ht_info->bCurBW40MHz) ? 112 - ((ht_info->bCurShortGI40MHz) ? 1 : 0) : 113 - ((ht_info->bCurShortGI20MHz) ? 1 : 0); 114 - return MCS_DATA_RATE[is40MHz][isShortGI][(nMcsRate & 0x7f)]; 90 + u8 is40MHz = (ht_info->cur_bw_40mhz) ? 1 : 0; 91 + u8 isShortGI = (ht_info->cur_bw_40mhz) ? 92 + ((ht_info->cur_short_gi_40mhz) ? 1 : 0) : 93 + ((ht_info->cur_short_gi_20mhz) ? 1 : 0); 94 + return MCS_DATA_RATE[is40MHz][isShortGI][(mcs_rate & 0x7f)]; 115 95 } 116 96 117 - u16 TxCountToDataRate(struct rtllib_device *ieee, u8 nDataRate) 97 + u16 tx_count_to_data_rate(struct rtllib_device *ieee, u8 data_rate) 118 98 { 119 - u16 CCKOFDMRate[12] = {0x02, 0x04, 0x0b, 0x16, 0x0c, 0x12, 0x18, 99 + u16 cck_of_dm_rate[12] = {0x02, 0x04, 0x0b, 0x16, 0x0c, 0x12, 0x18, 120 100 0x24, 0x30, 0x48, 0x60, 0x6c}; 121 101 u8 is40MHz = 0; 122 102 u8 isShortGI = 0; 123 103 124 - if (nDataRate < 12) 125 - return CCKOFDMRate[nDataRate]; 126 - if (nDataRate >= 0x10 && nDataRate <= 0x1f) { 104 + if (data_rate < 12) 105 + return cck_of_dm_rate[data_rate]; 106 + if (data_rate >= 0x10 && data_rate <= 0x1f) { 127 107 is40MHz = 0; 128 108 isShortGI = 0; 129 - } else if (nDataRate >= 0x20 && nDataRate <= 0x2f) { 109 + } else if (data_rate >= 0x20 && data_rate <= 0x2f) { 130 110 is40MHz = 1; 131 111 isShortGI = 0; 132 - } else if (nDataRate >= 0x30 && nDataRate <= 0x3f) { 112 + } else if (data_rate >= 0x30 && data_rate <= 0x3f) { 133 113 is40MHz = 0; 134 114 isShortGI = 1; 135 - } else if (nDataRate >= 0x40 && nDataRate <= 0x4f) { 115 + } else if (data_rate >= 0x40 && data_rate <= 0x4f) { 136 116 is40MHz = 1; 137 117 isShortGI = 1; 138 118 } 139 - return MCS_DATA_RATE[is40MHz][isShortGI][nDataRate & 0xf]; 119 + return MCS_DATA_RATE[is40MHz][isShortGI][data_rate & 0xf]; 140 120 } 141 121 142 - bool IsHTHalfNmodeAPs(struct rtllib_device *ieee) 122 + bool is_ht_half_nmode_aps(struct rtllib_device *ieee) 143 123 { 144 124 bool retValue = false; 145 125 struct rtllib_network *net = &ieee->current_network; ··· 144 164 return retValue; 145 165 } 146 166 147 - static void HTIOTPeerDetermine(struct rtllib_device *ieee) 167 + static void ht_iot_peer_determine(struct rtllib_device *ieee) 148 168 { 149 169 struct rt_hi_throughput *ht_info = ieee->ht_info; 150 170 struct rtllib_network *net = &ieee->current_network; 151 171 152 172 if (net->bssht.bd_rt2rt_aggregation) { 153 - ht_info->IOTPeer = HT_IOT_PEER_REALTEK; 173 + ht_info->iot_peer = HT_IOT_PEER_REALTEK; 154 174 if (net->bssht.rt2rt_ht_mode & RT_HT_CAP_USE_92SE) 155 - ht_info->IOTPeer = HT_IOT_PEER_REALTEK_92SE; 175 + ht_info->iot_peer = HT_IOT_PEER_REALTEK_92SE; 156 176 if (net->bssht.rt2rt_ht_mode & RT_HT_CAP_USE_SOFTAP) 157 - ht_info->IOTPeer = HT_IOT_PEER_92U_SOFTAP; 177 + ht_info->iot_peer = HT_IOT_PEER_92U_SOFTAP; 158 178 } else if (net->broadcom_cap_exist) { 159 - ht_info->IOTPeer = HT_IOT_PEER_BROADCOM; 179 + ht_info->iot_peer = HT_IOT_PEER_BROADCOM; 160 180 } else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) || 161 181 !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) || 162 182 !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)) { 163 - ht_info->IOTPeer = HT_IOT_PEER_BROADCOM; 183 + ht_info->iot_peer = HT_IOT_PEER_BROADCOM; 164 184 } else if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) || 165 185 (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3) == 0) || 166 186 (memcmp(net->bssid, PCI_RALINK, 3) == 0) || 167 187 (memcmp(net->bssid, EDIMAX_RALINK, 3) == 0) || 168 188 (memcmp(net->bssid, AIRLINK_RALINK, 3) == 0) || 169 189 net->ralink_cap_exist) { 170 - ht_info->IOTPeer = HT_IOT_PEER_RALINK; 190 + ht_info->iot_peer = HT_IOT_PEER_RALINK; 171 191 } else if ((net->atheros_cap_exist) || 172 192 (memcmp(net->bssid, DLINK_ATHEROS_1, 3) == 0) || 173 193 (memcmp(net->bssid, DLINK_ATHEROS_2, 3) == 0)) { 174 - ht_info->IOTPeer = HT_IOT_PEER_ATHEROS; 194 + ht_info->iot_peer = HT_IOT_PEER_ATHEROS; 175 195 } else if ((memcmp(net->bssid, CISCO_BROADCOM, 3) == 0) || 176 196 net->cisco_cap_exist) { 177 - ht_info->IOTPeer = HT_IOT_PEER_CISCO; 197 + ht_info->iot_peer = HT_IOT_PEER_CISCO; 178 198 } else if ((memcmp(net->bssid, LINKSYS_MARVELL_4400N, 3) == 0) || 179 199 net->marvell_cap_exist) { 180 - ht_info->IOTPeer = HT_IOT_PEER_MARVELL; 200 + ht_info->iot_peer = HT_IOT_PEER_MARVELL; 181 201 } else if (net->airgo_cap_exist) { 182 - ht_info->IOTPeer = HT_IOT_PEER_AIRGO; 202 + ht_info->iot_peer = HT_IOT_PEER_AIRGO; 183 203 } else { 184 - ht_info->IOTPeer = HT_IOT_PEER_UNKNOWN; 204 + ht_info->iot_peer = HT_IOT_PEER_UNKNOWN; 185 205 } 186 206 187 - netdev_dbg(ieee->dev, "IOTPEER: %x\n", ht_info->IOTPeer); 207 + netdev_dbg(ieee->dev, "IOTPEER: %x\n", ht_info->iot_peer); 188 208 } 189 209 190 - static u8 HTIOTActIsMgntUseCCK6M(struct rtllib_device *ieee, 210 + static u8 ht_iot_act_is_mgnt_use_cck_6m(struct rtllib_device *ieee, 191 211 struct rtllib_network *network) 192 212 { 193 213 u8 retValue = 0; 194 214 195 - if (ieee->ht_info->IOTPeer == HT_IOT_PEER_BROADCOM) 215 + if (ieee->ht_info->iot_peer == HT_IOT_PEER_BROADCOM) 196 216 retValue = 1; 197 217 198 218 return retValue; 199 219 } 200 220 201 - static u8 HTIOTActIsCCDFsync(struct rtllib_device *ieee) 221 + static u8 ht_iot_act_is_ccd_fsync(struct rtllib_device *ieee) 202 222 { 203 223 u8 retValue = 0; 204 224 205 - if (ieee->ht_info->IOTPeer == HT_IOT_PEER_BROADCOM) 225 + if (ieee->ht_info->iot_peer == HT_IOT_PEER_BROADCOM) 206 226 retValue = 1; 207 227 return retValue; 208 228 } 209 229 210 - static void HTIOTActDetermineRaFunc(struct rtllib_device *ieee, bool bPeerRx2ss) 230 + static void ht_iot_act_determine_ra_func(struct rtllib_device *ieee, bool bPeerRx2ss) 211 231 { 212 232 struct rt_hi_throughput *ht_info = ieee->ht_info; 213 233 214 234 ht_info->iot_ra_func &= HT_IOT_RAFUNC_DISABLE_ALL; 215 235 216 - if (ht_info->IOTPeer == HT_IOT_PEER_RALINK && !bPeerRx2ss) 236 + if (ht_info->iot_peer == HT_IOT_PEER_RALINK && !bPeerRx2ss) 217 237 ht_info->iot_ra_func |= HT_IOT_RAFUNC_PEER_1R; 218 238 219 239 if (ht_info->iot_action & HT_IOT_ACT_AMSDU_ENABLE) 220 240 ht_info->iot_ra_func |= HT_IOT_RAFUNC_TX_AMSDU; 221 241 } 222 242 223 - void HTResetIOTSetting(struct rt_hi_throughput *ht_info) 243 + void ht_reset_iot_setting(struct rt_hi_throughput *ht_info) 224 244 { 225 245 ht_info->iot_action = 0; 226 - ht_info->IOTPeer = HT_IOT_PEER_UNKNOWN; 246 + ht_info->iot_peer = HT_IOT_PEER_UNKNOWN; 227 247 ht_info->iot_ra_func = 0; 228 248 } 229 249 230 - void HTConstructCapabilityElement(struct rtllib_device *ieee, u8 *posHTCap, 231 - u8 *len, u8 IsEncrypt, bool bAssoc) 250 + void ht_construct_capability_element(struct rtllib_device *ieee, u8 *pos_ht_cap, 251 + u8 *len, u8 is_encrypt, bool assoc) 232 252 { 233 - struct rt_hi_throughput *pHT = ieee->ht_info; 234 - struct ht_capab_ele *pCapELE = NULL; 253 + struct rt_hi_throughput *ht = ieee->ht_info; 254 + struct ht_capab_ele *cap_ele = NULL; 235 255 236 - if (!posHTCap || !pHT) { 256 + if (!pos_ht_cap || !ht) { 237 257 netdev_warn(ieee->dev, 238 258 "%s(): posHTCap and ht_info are null\n", __func__); 239 259 return; 240 260 } 241 - memset(posHTCap, 0, *len); 261 + memset(pos_ht_cap, 0, *len); 242 262 243 - if ((bAssoc) && (pHT->ePeerHTSpecVer == HT_SPEC_VER_EWC)) { 263 + if ((assoc) && (ht->peer_ht_spec_ver == HT_SPEC_VER_EWC)) { 244 264 static const u8 EWC11NHTCap[] = { 0x00, 0x90, 0x4c, 0x33 }; 245 265 246 - memcpy(posHTCap, EWC11NHTCap, sizeof(EWC11NHTCap)); 247 - pCapELE = (struct ht_capab_ele *)&posHTCap[4]; 266 + memcpy(pos_ht_cap, EWC11NHTCap, sizeof(EWC11NHTCap)); 267 + cap_ele = (struct ht_capab_ele *)&pos_ht_cap[4]; 248 268 *len = 30 + 2; 249 269 } else { 250 - pCapELE = (struct ht_capab_ele *)posHTCap; 270 + cap_ele = (struct ht_capab_ele *)pos_ht_cap; 251 271 *len = 26 + 2; 252 272 } 253 273 254 - pCapELE->AdvCoding = 0; 274 + cap_ele->AdvCoding = 0; 255 275 if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) 256 - pCapELE->ChlWidth = 0; 276 + cap_ele->ChlWidth = 0; 257 277 else 258 - pCapELE->ChlWidth = (pHT->bRegBW40MHz ? 1 : 0); 278 + cap_ele->ChlWidth = 1; 259 279 260 - pCapELE->MimoPwrSave = pHT->self_mimo_ps; 261 - pCapELE->GreenField = 0; 262 - pCapELE->ShortGI20Mhz = 1; 263 - pCapELE->ShortGI40Mhz = 1; 280 + cap_ele->MimoPwrSave = 3; 281 + cap_ele->GreenField = 0; 282 + cap_ele->ShortGI20Mhz = 1; 283 + cap_ele->ShortGI40Mhz = 1; 264 284 265 - pCapELE->TxSTBC = 1; 266 - pCapELE->RxSTBC = 0; 267 - pCapELE->DelayBA = 0; 268 - pCapELE->MaxAMSDUSize = (MAX_RECEIVE_BUFFER_SIZE >= 7935) ? 1 : 0; 269 - pCapELE->DssCCk = ((pHT->bRegBW40MHz) ? (pHT->bRegSuppCCK ? 1 : 0) : 0); 270 - pCapELE->PSMP = 0; 271 - pCapELE->LSigTxopProtect = 0; 285 + cap_ele->TxSTBC = 1; 286 + cap_ele->RxSTBC = 0; 287 + cap_ele->DelayBA = 0; 288 + cap_ele->MaxAMSDUSize = (MAX_RECEIVE_BUFFER_SIZE >= 7935) ? 1 : 0; 289 + cap_ele->DssCCk = 1; 290 + cap_ele->PSMP = 0; 291 + cap_ele->LSigTxopProtect = 0; 272 292 273 293 netdev_dbg(ieee->dev, 274 294 "TX HT cap/info ele BW=%d MaxAMSDUSize:%d DssCCk:%d\n", 275 - pCapELE->ChlWidth, pCapELE->MaxAMSDUSize, pCapELE->DssCCk); 295 + cap_ele->ChlWidth, cap_ele->MaxAMSDUSize, cap_ele->DssCCk); 276 296 277 - if (IsEncrypt) { 278 - pCapELE->MPDUDensity = 7; 279 - pCapELE->MaxRxAMPDUFactor = 2; 297 + if (is_encrypt) { 298 + cap_ele->MPDUDensity = 7; 299 + cap_ele->MaxRxAMPDUFactor = 2; 280 300 } else { 281 - pCapELE->MaxRxAMPDUFactor = 3; 282 - pCapELE->MPDUDensity = 0; 301 + cap_ele->MaxRxAMPDUFactor = 3; 302 + cap_ele->MPDUDensity = 0; 283 303 } 284 304 285 - memcpy(pCapELE->MCS, ieee->reg_dot11ht_oper_rate_set, 16); 286 - memset(&pCapELE->ExtHTCapInfo, 0, 2); 287 - memset(pCapELE->TxBFCap, 0, 4); 305 + memcpy(cap_ele->MCS, ieee->reg_dot11ht_oper_rate_set, 16); 306 + memset(&cap_ele->ExtHTCapInfo, 0, 2); 307 + memset(cap_ele->TxBFCap, 0, 4); 288 308 289 - pCapELE->ASCap = 0; 309 + cap_ele->ASCap = 0; 290 310 291 - if (bAssoc) { 292 - if (pHT->iot_action & HT_IOT_ACT_DISABLE_MCS15) 293 - pCapELE->MCS[1] &= 0x7f; 311 + if (assoc) { 312 + if (ht->iot_action & HT_IOT_ACT_DISABLE_MCS15) 313 + cap_ele->MCS[1] &= 0x7f; 294 314 295 - if (pHT->iot_action & HT_IOT_ACT_DISABLE_MCS14) 296 - pCapELE->MCS[1] &= 0xbf; 315 + if (ht->iot_action & HT_IOT_ACT_DISABLE_MCS14) 316 + cap_ele->MCS[1] &= 0xbf; 297 317 298 - if (pHT->iot_action & HT_IOT_ACT_DISABLE_ALL_2SS) 299 - pCapELE->MCS[1] &= 0x00; 318 + if (ht->iot_action & HT_IOT_ACT_DISABLE_ALL_2SS) 319 + cap_ele->MCS[1] &= 0x00; 300 320 301 - if (pHT->iot_action & HT_IOT_ACT_DISABLE_RX_40MHZ_SHORT_GI) 302 - pCapELE->ShortGI40Mhz = 0; 321 + if (ht->iot_action & HT_IOT_ACT_DISABLE_RX_40MHZ_SHORT_GI) 322 + cap_ele->ShortGI40Mhz = 0; 303 323 304 324 if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) { 305 - pCapELE->ChlWidth = 0; 306 - pCapELE->MCS[1] = 0; 325 + cap_ele->ChlWidth = 0; 326 + cap_ele->MCS[1] = 0; 307 327 } 308 328 } 309 329 } 310 330 311 - void HTConstructInfoElement(struct rtllib_device *ieee, u8 *posHTInfo, 312 - u8 *len, u8 IsEncrypt) 313 - { 314 - struct ht_info_ele *pHTInfoEle = (struct ht_info_ele *)posHTInfo; 315 - 316 - if (!posHTInfo || !pHTInfoEle) { 317 - netdev_warn(ieee->dev, 318 - "%s(): posHTInfo and pHTInfoEle are null\n", 319 - __func__); 320 - return; 321 - } 322 - 323 - memset(posHTInfo, 0, *len); 324 - *len = 0; 325 - } 326 - 327 - void HTConstructRT2RTAggElement(struct rtllib_device *ieee, u8 *posRT2RTAgg, 331 + void ht_construct_rt2rt_agg_element(struct rtllib_device *ieee, u8 *posRT2RTAgg, 328 332 u8 *len) 329 333 { 330 334 if (!posRT2RTAgg) { ··· 330 366 *len = 6 + 2; 331 367 } 332 368 333 - static u8 HT_PickMCSRate(struct rtllib_device *ieee, u8 *pOperateMCS) 369 + static u8 ht_pick_mcs_rate(struct rtllib_device *ieee, u8 *pOperateMCS) 334 370 { 335 371 u8 i; 336 372 ··· 357 393 return true; 358 394 } 359 395 360 - u8 HTGetHighestMCSRate(struct rtllib_device *ieee, u8 *pMCSRateSet, 396 + u8 ht_get_highest_mcs_rate(struct rtllib_device *ieee, u8 *pMCSRateSet, 361 397 u8 *pMCSFilter) 362 398 { 363 399 u8 i, j; ··· 386 422 bitMap = availableMcsRate[i]; 387 423 for (j = 0; j < 8; j++) { 388 424 if ((bitMap % 2) != 0) { 389 - if (HTMcsToDataRate(ieee, (8 * i + j)) > 390 - HTMcsToDataRate(ieee, mcsRate)) 425 + if (ht_mcs_to_data_rate(ieee, (8 * i + j)) > 426 + ht_mcs_to_data_rate(ieee, mcsRate)) 391 427 mcsRate = 8 * i + j; 392 428 } 393 429 bitMap >>= 1; ··· 397 433 return mcsRate | 0x80; 398 434 } 399 435 400 - static u8 HTFilterMCSRate(struct rtllib_device *ieee, u8 *pSupportMCS, 436 + static u8 ht_filter_mcs_rate(struct rtllib_device *ieee, u8 *pSupportMCS, 401 437 u8 *pOperateMCS) 402 438 { 403 439 u8 i; ··· 406 442 pOperateMCS[i] = ieee->reg_dot11tx_ht_oper_rate_set[i] & 407 443 pSupportMCS[i]; 408 444 409 - HT_PickMCSRate(ieee, pOperateMCS); 445 + ht_pick_mcs_rate(ieee, pOperateMCS); 410 446 411 447 if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) 412 448 pOperateMCS[1] = 0; ··· 417 453 return true; 418 454 } 419 455 420 - void HTSetConnectBwMode(struct rtllib_device *ieee, 456 + void ht_set_connect_bw_mode(struct rtllib_device *ieee, 421 457 enum ht_channel_width bandwidth, 422 458 enum ht_extchnl_offset Offset); 423 459 424 - void HTOnAssocRsp(struct rtllib_device *ieee) 460 + void ht_on_assoc_rsp(struct rtllib_device *ieee) 425 461 { 426 462 struct rt_hi_throughput *ht_info = ieee->ht_info; 427 463 struct ht_capab_ele *pPeerHTCap = NULL; 428 464 struct ht_info_ele *pPeerHTInfo = NULL; 429 - u16 nMaxAMSDUSize = 0; 430 465 u8 *pMcsFilter = NULL; 431 466 432 467 static const u8 EWC11NHTCap[] = { 0x00, 0x90, 0x4c, 0x33 }; ··· 452 489 print_hex_dump_bytes("%s: ", __func__, DUMP_PREFIX_NONE, 453 490 pPeerHTCap, sizeof(struct ht_capab_ele)); 454 491 #endif 455 - HTSetConnectBwMode(ieee, (enum ht_channel_width)(pPeerHTCap->ChlWidth), 492 + ht_set_connect_bw_mode(ieee, (enum ht_channel_width)(pPeerHTCap->ChlWidth), 456 493 (enum ht_extchnl_offset)(pPeerHTInfo->ExtChlOffset)); 457 494 ht_info->cur_tx_bw40mhz = ((pPeerHTInfo->RecommemdedTxWidth == 1) ? 458 495 true : false); 459 496 460 - ht_info->bCurShortGI20MHz = ((ht_info->bRegShortGI20MHz) ? 461 - ((pPeerHTCap->ShortGI20Mhz == 1) ? 462 - true : false) : false); 463 - ht_info->bCurShortGI40MHz = ((ht_info->bRegShortGI40MHz) ? 464 - ((pPeerHTCap->ShortGI40Mhz == 1) ? 465 - true : false) : false); 497 + ht_info->cur_short_gi_20mhz = ((pPeerHTCap->ShortGI20Mhz == 1) ? true : false); 498 + ht_info->cur_short_gi_40mhz = ((pPeerHTCap->ShortGI40Mhz == 1) ? true : false); 466 499 467 - ht_info->bCurSuppCCK = ((ht_info->bRegSuppCCK) ? 468 - ((pPeerHTCap->DssCCk == 1) ? true : 469 - false) : false); 470 - 471 - ht_info->bCurrent_AMSDU_Support = ht_info->bAMSDU_Support; 472 - 473 - nMaxAMSDUSize = (pPeerHTCap->MaxAMSDUSize == 0) ? 3839 : 7935; 474 - 475 - if (ht_info->nAMSDU_MaxSize > nMaxAMSDUSize) 476 - ht_info->nCurrent_AMSDU_MaxSize = nMaxAMSDUSize; 477 - else 478 - ht_info->nCurrent_AMSDU_MaxSize = ht_info->nAMSDU_MaxSize; 479 - 480 - ht_info->bCurrentAMPDUEnable = ht_info->bAMPDUEnable; 500 + ht_info->current_ampdu_enable = ht_info->ampdu_enable; 481 501 if (ieee->rtllib_ap_sec_type && 482 502 (ieee->rtllib_ap_sec_type(ieee) & (SEC_ALG_WEP | SEC_ALG_TKIP))) { 483 - if ((ht_info->IOTPeer == HT_IOT_PEER_ATHEROS) || 484 - (ht_info->IOTPeer == HT_IOT_PEER_UNKNOWN)) 485 - ht_info->bCurrentAMPDUEnable = false; 503 + if ((ht_info->iot_peer == HT_IOT_PEER_ATHEROS) || 504 + (ht_info->iot_peer == HT_IOT_PEER_UNKNOWN)) 505 + ht_info->current_ampdu_enable = false; 486 506 } 487 507 488 - if (!ht_info->reg_rt2rt_aggregation) { 489 - if (ht_info->AMPDU_Factor > pPeerHTCap->MaxRxAMPDUFactor) 508 + if (ieee->current_network.bssht.bd_rt2rt_aggregation) { 509 + if (ieee->pairwise_key_type != KEY_TYPE_NA) 490 510 ht_info->CurrentAMPDUFactor = 491 - pPeerHTCap->MaxRxAMPDUFactor; 511 + pPeerHTCap->MaxRxAMPDUFactor; 492 512 else 493 - ht_info->CurrentAMPDUFactor = ht_info->AMPDU_Factor; 494 - 513 + ht_info->CurrentAMPDUFactor = HT_AGG_SIZE_64K; 495 514 } else { 496 - if (ieee->current_network.bssht.bd_rt2rt_aggregation) { 497 - if (ieee->pairwise_key_type != KEY_TYPE_NA) 498 - ht_info->CurrentAMPDUFactor = 499 - pPeerHTCap->MaxRxAMPDUFactor; 500 - else 501 - ht_info->CurrentAMPDUFactor = HT_AGG_SIZE_64K; 502 - } else { 503 - ht_info->CurrentAMPDUFactor = min_t(u32, pPeerHTCap->MaxRxAMPDUFactor, 504 - HT_AGG_SIZE_32K); 505 - } 515 + ht_info->CurrentAMPDUFactor = min_t(u32, pPeerHTCap->MaxRxAMPDUFactor, 516 + HT_AGG_SIZE_32K); 506 517 } 507 - ht_info->current_mpdu_density = max_t(u8, ht_info->MPDU_Density, 508 - pPeerHTCap->MPDUDensity); 518 + 519 + ht_info->current_mpdu_density = pPeerHTCap->MPDUDensity; 509 520 if (ht_info->iot_action & HT_IOT_ACT_TX_USE_AMSDU_8K) { 510 - ht_info->bCurrentAMPDUEnable = false; 511 - ht_info->ForcedAMSDUMode = HT_AGG_FORCE_ENABLE; 521 + ht_info->current_ampdu_enable = false; 512 522 } 513 - ht_info->cur_rx_reorder_enable = ht_info->reg_rx_reorder_enable; 523 + ht_info->cur_rx_reorder_enable = 1; 514 524 515 525 if (pPeerHTCap->MCS[0] == 0) 516 526 pPeerHTCap->MCS[0] = 0xff; 517 527 518 - HTIOTActDetermineRaFunc(ieee, ((pPeerHTCap->MCS[1]) != 0)); 528 + ht_iot_act_determine_ra_func(ieee, ((pPeerHTCap->MCS[1]) != 0)); 519 529 520 - HTFilterMCSRate(ieee, pPeerHTCap->MCS, ieee->dot11ht_oper_rate_set); 530 + ht_filter_mcs_rate(ieee, pPeerHTCap->MCS, ieee->dot11ht_oper_rate_set); 521 531 522 - ht_info->peer_mimo_ps = pPeerHTCap->MimoPwrSave; 523 - if (ht_info->peer_mimo_ps == MIMO_PS_STATIC) 524 - pMcsFilter = MCS_FILTER_1SS; 525 - else 526 - pMcsFilter = MCS_FILTER_ALL; 527 - ieee->HTHighestOperaRate = HTGetHighestMCSRate(ieee, 532 + pMcsFilter = MCS_FILTER_ALL; 533 + ieee->HTHighestOperaRate = ht_get_highest_mcs_rate(ieee, 528 534 ieee->dot11ht_oper_rate_set, 529 535 pMcsFilter); 530 536 ieee->HTCurrentOperaRate = ieee->HTHighestOperaRate; ··· 501 569 ht_info->current_op_mode = pPeerHTInfo->OptMode; 502 570 } 503 571 504 - void HTInitializeHTInfo(struct rtllib_device *ieee) 572 + void ht_initialize_ht_info(struct rtllib_device *ieee) 505 573 { 506 574 struct rt_hi_throughput *ht_info = ieee->ht_info; 507 575 508 576 ht_info->current_ht_support = false; 509 577 510 - ht_info->bCurBW40MHz = false; 578 + ht_info->cur_bw_40mhz = false; 511 579 ht_info->cur_tx_bw40mhz = false; 512 580 513 - ht_info->bCurShortGI20MHz = false; 514 - ht_info->bCurShortGI40MHz = false; 515 - ht_info->forced_short_gi = false; 581 + ht_info->cur_short_gi_20mhz = false; 582 + ht_info->cur_short_gi_40mhz = false; 516 583 517 - ht_info->bCurSuppCCK = true; 518 - 519 - ht_info->bCurrent_AMSDU_Support = false; 520 - ht_info->nCurrent_AMSDU_MaxSize = ht_info->nAMSDU_MaxSize; 521 - ht_info->current_mpdu_density = ht_info->MPDU_Density; 522 - ht_info->CurrentAMPDUFactor = ht_info->AMPDU_Factor; 584 + ht_info->current_mpdu_density = 0; 585 + ht_info->CurrentAMPDUFactor = ht_info->ampdu_factor; 523 586 524 587 memset((void *)(&ht_info->SelfHTCap), 0, 525 588 sizeof(ht_info->SelfHTCap)); 526 - memset((void *)(&ht_info->SelfHTInfo), 0, 527 - sizeof(ht_info->SelfHTInfo)); 528 589 memset((void *)(&ht_info->PeerHTCapBuf), 0, 529 590 sizeof(ht_info->PeerHTCapBuf)); 530 591 memset((void *)(&ht_info->PeerHTInfoBuf), 0, ··· 525 600 526 601 ht_info->sw_bw_in_progress = false; 527 602 528 - ht_info->ePeerHTSpecVer = HT_SPEC_VER_IEEE; 603 + ht_info->peer_ht_spec_ver = HT_SPEC_VER_IEEE; 529 604 530 605 ht_info->current_rt2rt_aggregation = false; 531 606 ht_info->current_rt2rt_long_slot_time = false; 532 - ht_info->RT2RT_HT_Mode = (enum rt_ht_capability)0; 533 607 534 - ht_info->IOTPeer = 0; 608 + ht_info->iot_peer = 0; 535 609 ht_info->iot_action = 0; 536 610 ht_info->iot_ra_func = 0; 537 611 ··· 543 619 } 544 620 } 545 621 546 - void HTInitializeBssDesc(struct bss_ht *pBssHT) 622 + void ht_initialize_bss_desc(struct bss_ht *pBssHT) 547 623 { 548 624 pBssHT->bd_support_ht = false; 549 625 memset(pBssHT->bd_ht_cap_buf, 0, sizeof(pBssHT->bd_ht_cap_buf)); ··· 558 634 pBssHT->rt2rt_ht_mode = (enum rt_ht_capability)0; 559 635 } 560 636 561 - void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee, 637 + void ht_reset_self_and_save_peer_setting(struct rtllib_device *ieee, 562 638 struct rtllib_network *pNetwork) 563 639 { 564 640 struct rt_hi_throughput *ht_info = ieee->ht_info; ··· 569 645 */ 570 646 if (pNetwork->bssht.bd_support_ht) { 571 647 ht_info->current_ht_support = true; 572 - ht_info->ePeerHTSpecVer = pNetwork->bssht.bd_ht_spec_ver; 648 + ht_info->peer_ht_spec_ver = pNetwork->bssht.bd_ht_spec_ver; 573 649 574 650 if (pNetwork->bssht.bd_ht_cap_len > 0 && 575 651 pNetwork->bssht.bd_ht_cap_len <= sizeof(ht_info->PeerHTCapBuf)) ··· 584 660 pNetwork->bssht.bd_ht_info_buf, 585 661 pNetwork->bssht.bd_ht_info_len); 586 662 587 - if (ht_info->reg_rt2rt_aggregation) { 588 - ht_info->current_rt2rt_aggregation = 589 - pNetwork->bssht.bd_rt2rt_aggregation; 590 - ht_info->current_rt2rt_long_slot_time = 591 - pNetwork->bssht.bd_rt2rt_long_slot_time; 592 - ht_info->RT2RT_HT_Mode = pNetwork->bssht.rt2rt_ht_mode; 593 - } else { 594 - ht_info->current_rt2rt_aggregation = false; 595 - ht_info->current_rt2rt_long_slot_time = false; 596 - ht_info->RT2RT_HT_Mode = (enum rt_ht_capability)0; 597 - } 663 + ht_info->current_rt2rt_aggregation = 664 + pNetwork->bssht.bd_rt2rt_aggregation; 665 + ht_info->current_rt2rt_long_slot_time = 666 + pNetwork->bssht.bd_rt2rt_long_slot_time; 598 667 599 - HTIOTPeerDetermine(ieee); 668 + ht_iot_peer_determine(ieee); 600 669 601 670 ht_info->iot_action = 0; 602 - bIOTAction = HTIOTActIsMgntUseCCK6M(ieee, pNetwork); 671 + bIOTAction = ht_iot_act_is_mgnt_use_cck_6m(ieee, pNetwork); 603 672 if (bIOTAction) 604 673 ht_info->iot_action |= HT_IOT_ACT_MGNT_USE_CCK_6M; 605 - bIOTAction = HTIOTActIsCCDFsync(ieee); 674 + bIOTAction = ht_iot_act_is_ccd_fsync(ieee); 606 675 if (bIOTAction) 607 676 ht_info->iot_action |= HT_IOT_ACT_CDD_FSYNC; 608 677 } else { 609 678 ht_info->current_ht_support = false; 610 679 ht_info->current_rt2rt_aggregation = false; 611 680 ht_info->current_rt2rt_long_slot_time = false; 612 - ht_info->RT2RT_HT_Mode = (enum rt_ht_capability)0; 613 681 614 682 ht_info->iot_action = 0; 615 683 ht_info->iot_ra_func = 0; ··· 622 706 } 623 707 EXPORT_SYMBOL(HT_update_self_and_peer_setting); 624 708 625 - u8 HTCCheck(struct rtllib_device *ieee, u8 *pFrame) 709 + u8 ht_c_check(struct rtllib_device *ieee, u8 *pFrame) 626 710 { 627 711 if (ieee->ht_info->current_ht_support) { 628 712 if ((IsQoSDataFrame(pFrame) && Frame_Order(pFrame)) == 1) { ··· 633 717 return false; 634 718 } 635 719 636 - static void HTSetConnectBwModeCallback(struct rtllib_device *ieee) 720 + static void ht_set_connect_bw_mode_callback(struct rtllib_device *ieee) 637 721 { 638 722 struct rt_hi_throughput *ht_info = ieee->ht_info; 639 723 640 - if (ht_info->bCurBW40MHz) { 724 + if (ht_info->cur_bw_40mhz) { 641 725 if (ht_info->CurSTAExtChnlOffset == HT_EXTCHNL_OFFSET_UPPER) 642 726 ieee->set_chan(ieee->dev, 643 727 ieee->current_network.channel + 2); ··· 660 744 ht_info->sw_bw_in_progress = false; 661 745 } 662 746 663 - void HTSetConnectBwMode(struct rtllib_device *ieee, 747 + void ht_set_connect_bw_mode(struct rtllib_device *ieee, 664 748 enum ht_channel_width bandwidth, 665 749 enum ht_extchnl_offset Offset) 666 750 { 667 751 struct rt_hi_throughput *ht_info = ieee->ht_info; 668 - 669 - if (!ht_info->bRegBW40MHz) 670 - return; 671 752 672 753 if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) 673 754 bandwidth = HT_CHANNEL_WIDTH_20; ··· 679 766 Offset = HT_EXTCHNL_OFFSET_NO_EXT; 680 767 if (Offset == HT_EXTCHNL_OFFSET_UPPER || 681 768 Offset == HT_EXTCHNL_OFFSET_LOWER) { 682 - ht_info->bCurBW40MHz = true; 769 + ht_info->cur_bw_40mhz = true; 683 770 ht_info->CurSTAExtChnlOffset = Offset; 684 771 } else { 685 - ht_info->bCurBW40MHz = false; 772 + ht_info->cur_bw_40mhz = false; 686 773 ht_info->CurSTAExtChnlOffset = HT_EXTCHNL_OFFSET_NO_EXT; 687 774 } 688 775 } else { 689 - ht_info->bCurBW40MHz = false; 776 + ht_info->cur_bw_40mhz = false; 690 777 ht_info->CurSTAExtChnlOffset = HT_EXTCHNL_OFFSET_NO_EXT; 691 778 } 692 779 693 780 netdev_dbg(ieee->dev, "%s():ht_info->bCurBW40MHz:%x\n", __func__, 694 - ht_info->bCurBW40MHz); 781 + ht_info->cur_bw_40mhz); 695 782 696 783 ht_info->sw_bw_in_progress = true; 697 784 698 - HTSetConnectBwModeCallback(ieee); 785 + ht_set_connect_bw_mode_callback(ieee); 699 786 }
+1 -1
drivers/staging/rtl8192e/rtl819x_Qos.h
··· 8 8 #define __INC_QOS_TYPE_H 9 9 10 10 struct qos_tsinfo { 11 - u8 ucTSID:4; 11 + u8 ts_id:4; 12 12 u8 ucDirection:2; 13 13 }; 14 14
+11 -11
drivers/staging/rtl8192e/rtl819x_TS.h
··· 17 17 }; 18 18 19 19 struct ts_common_info { 20 - struct list_head List; 20 + struct list_head list; 21 21 u8 addr[ETH_ALEN]; 22 - struct qos_tsinfo TSpec; 22 + struct qos_tsinfo tspec; 23 23 }; 24 24 25 25 struct tx_ts_record { 26 - struct ts_common_info TsCommonInfo; 27 - u16 TxCurSeq; 28 - struct ba_record TxPendingBARecord; 29 - struct ba_record TxAdmittedBARecord; 30 - u8 bAddBaReqInProgress; 31 - u8 bAddBaReqDelayed; 32 - u8 bUsingBa; 33 - u8 bDisable_AddBa; 34 - struct timer_list TsAddBaTimer; 26 + struct ts_common_info ts_common_info; 27 + u16 tx_cur_seq; 28 + struct ba_record tx_pending_ba_record; 29 + struct ba_record tx_admitted_ba_record; 30 + u8 add_ba_req_in_progress; 31 + u8 add_ba_req_delayed; 32 + u8 using_ba; 33 + u8 disable_add_ba; 34 + struct timer_list ts_add_ba_timer; 35 35 u8 num; 36 36 }; 37 37
+78 -78
drivers/staging/rtl8192e/rtl819x_TSProc.c
··· 12 12 { 13 13 struct rx_ts_record *ts = from_timer(ts, t, rx_pkt_pending_timer); 14 14 struct rtllib_device *ieee = container_of(ts, struct rtllib_device, 15 - RxTsRecord[ts->num]); 15 + rx_ts_records[ts->num]); 16 16 17 17 struct rx_reorder_entry *pReorderEntry = NULL; 18 18 ··· 25 25 while (!list_empty(&ts->rx_pending_pkt_list)) { 26 26 pReorderEntry = (struct rx_reorder_entry *) 27 27 list_entry(ts->rx_pending_pkt_list.prev, 28 - struct rx_reorder_entry, List); 28 + struct rx_reorder_entry, list); 29 29 if (index == 0) 30 30 ts->rx_indicate_seq = pReorderEntry->SeqNum; 31 31 ··· 33 33 ts->rx_indicate_seq) || 34 34 SN_EQUAL(pReorderEntry->SeqNum, 35 35 ts->rx_indicate_seq)) { 36 - list_del_init(&pReorderEntry->List); 36 + list_del_init(&pReorderEntry->list); 37 37 38 38 if (SN_EQUAL(pReorderEntry->SeqNum, 39 39 ts->rx_indicate_seq)) ··· 47 47 pReorderEntry->prxb; 48 48 index++; 49 49 50 - list_add_tail(&pReorderEntry->List, 50 + list_add_tail(&pReorderEntry->list, 51 51 &ieee->RxReorder_Unused_List); 52 52 } else { 53 53 bPktInBuf = true; ··· 82 82 83 83 static void TsAddBaProcess(struct timer_list *t) 84 84 { 85 - struct tx_ts_record *pTxTs = from_timer(pTxTs, t, TsAddBaTimer); 86 - u8 num = pTxTs->num; 87 - struct rtllib_device *ieee = container_of(pTxTs, struct rtllib_device, 88 - TxTsRecord[num]); 85 + struct tx_ts_record *ts = from_timer(ts, t, ts_add_ba_timer); 86 + u8 num = ts->num; 87 + struct rtllib_device *ieee = container_of(ts, struct rtllib_device, 88 + tx_ts_records[num]); 89 89 90 - rtllib_ts_init_add_ba(ieee, pTxTs, BA_POLICY_IMMEDIATE, false); 90 + rtllib_ts_init_add_ba(ieee, ts, BA_POLICY_IMMEDIATE, false); 91 91 netdev_dbg(ieee->dev, "%s(): ADDBA Req is started\n", __func__); 92 92 } 93 93 94 - static void ResetTsCommonInfo(struct ts_common_info *pTsCommonInfo) 94 + static void ResetTsCommonInfo(struct ts_common_info *ts_common_info) 95 95 { 96 - eth_zero_addr(pTsCommonInfo->addr); 97 - memset(&pTsCommonInfo->TSpec, 0, sizeof(struct qos_tsinfo)); 96 + eth_zero_addr(ts_common_info->addr); 97 + memset(&ts_common_info->tspec, 0, sizeof(struct qos_tsinfo)); 98 98 } 99 99 100 100 static void ResetTxTsEntry(struct tx_ts_record *ts) 101 101 { 102 - ResetTsCommonInfo(&ts->TsCommonInfo); 103 - ts->TxCurSeq = 0; 104 - ts->bAddBaReqInProgress = false; 105 - ts->bAddBaReqDelayed = false; 106 - ts->bUsingBa = false; 107 - ts->bDisable_AddBa = false; 108 - rtllib_reset_ba_entry(&ts->TxAdmittedBARecord); 109 - rtllib_reset_ba_entry(&ts->TxPendingBARecord); 102 + ResetTsCommonInfo(&ts->ts_common_info); 103 + ts->tx_cur_seq = 0; 104 + ts->add_ba_req_in_progress = false; 105 + ts->add_ba_req_delayed = false; 106 + ts->using_ba = false; 107 + ts->disable_add_ba = false; 108 + rtllib_reset_ba_entry(&ts->tx_admitted_ba_record); 109 + rtllib_reset_ba_entry(&ts->tx_pending_ba_record); 110 110 } 111 111 112 112 static void ResetRxTsEntry(struct rx_ts_record *ts) ··· 119 119 120 120 void rtllib_ts_init(struct rtllib_device *ieee) 121 121 { 122 - struct tx_ts_record *pTxTS = ieee->TxTsRecord; 123 - struct rx_ts_record *rxts = ieee->RxTsRecord; 122 + struct tx_ts_record *pTxTS = ieee->tx_ts_records; 123 + struct rx_ts_record *rxts = ieee->rx_ts_records; 124 124 struct rx_reorder_entry *pRxReorderEntry = ieee->RxReorderEntry; 125 125 u8 count = 0; 126 126 ··· 130 130 131 131 for (count = 0; count < TOTAL_TS_NUM; count++) { 132 132 pTxTS->num = count; 133 - timer_setup(&pTxTS->TsAddBaTimer, TsAddBaProcess, 0); 133 + timer_setup(&pTxTS->ts_add_ba_timer, TsAddBaProcess, 0); 134 134 135 - timer_setup(&pTxTS->TxPendingBARecord.timer, rtllib_ba_setup_timeout, 135 + timer_setup(&pTxTS->tx_pending_ba_record.timer, rtllib_ba_setup_timeout, 136 136 0); 137 - timer_setup(&pTxTS->TxAdmittedBARecord.timer, 137 + timer_setup(&pTxTS->tx_admitted_ba_record.timer, 138 138 rtllib_tx_ba_inact_timeout, 0); 139 139 140 140 ResetTxTsEntry(pTxTS); 141 - list_add_tail(&pTxTS->TsCommonInfo.List, 141 + list_add_tail(&pTxTS->ts_common_info.list, 142 142 &ieee->Tx_TS_Unused_List); 143 143 pTxTS++; 144 144 } ··· 155 155 timer_setup(&rxts->rx_pkt_pending_timer, RxPktPendingTimeout, 0); 156 156 157 157 ResetRxTsEntry(rxts); 158 - list_add_tail(&rxts->ts_common_info.List, 158 + list_add_tail(&rxts->ts_common_info.list, 159 159 &ieee->Rx_TS_Unused_List); 160 160 rxts++; 161 161 } 162 162 INIT_LIST_HEAD(&ieee->RxReorder_Unused_List); 163 163 for (count = 0; count < REORDER_ENTRY_NUM; count++) { 164 - list_add_tail(&pRxReorderEntry->List, 164 + list_add_tail(&pRxReorderEntry->list, 165 165 &ieee->RxReorder_Unused_List); 166 166 if (count == (REORDER_ENTRY_NUM - 1)) 167 167 break; ··· 196 196 for (dir = 0; dir <= DIR_BI_DIR; dir++) { 197 197 if (!search_dir[dir]) 198 198 continue; 199 - list_for_each_entry(pRet, psearch_list, List) { 199 + list_for_each_entry(pRet, psearch_list, list) { 200 200 if (memcmp(pRet->addr, addr, 6) == 0 && 201 - pRet->TSpec.ucTSID == TID && 202 - pRet->TSpec.ucDirection == dir) 201 + pRet->tspec.ts_id == TID && 202 + pRet->tspec.ucDirection == dir) 203 203 break; 204 204 } 205 - if (&pRet->List != psearch_list) 205 + if (&pRet->list != psearch_list) 206 206 break; 207 207 } 208 208 209 - if (pRet && &pRet->List != psearch_list) 209 + if (pRet && &pRet->list != psearch_list) 210 210 return pRet; 211 211 return NULL; 212 212 } 213 213 214 - static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *addr, 214 + static void MakeTSEntry(struct ts_common_info *ts_common_info, u8 *addr, 215 215 struct qos_tsinfo *pTSPEC) 216 216 { 217 - if (!pTsCommonInfo) 217 + if (!ts_common_info) 218 218 return; 219 219 220 - memcpy(pTsCommonInfo->addr, addr, 6); 220 + memcpy(ts_common_info->addr, addr, 6); 221 221 222 222 if (pTSPEC) 223 - memcpy((u8 *)(&(pTsCommonInfo->TSpec)), (u8 *)pTSPEC, 223 + memcpy((u8 *)(&(ts_common_info->tspec)), (u8 *)pTSPEC, 224 224 sizeof(struct qos_tsinfo)); 225 225 } 226 226 ··· 228 228 u8 *addr, u8 TID, enum tr_select TxRxSelect, bool bAddNewTs) 229 229 { 230 230 u8 UP = 0; 231 - struct qos_tsinfo TSpec; 232 - struct qos_tsinfo *ts_info = &TSpec; 231 + struct qos_tsinfo tspec; 232 + struct qos_tsinfo *ts_info = &tspec; 233 233 struct list_head *pUnusedList; 234 234 struct list_head *pAddmitList; 235 235 enum direction_value Dir; ··· 286 286 287 287 if (!list_empty(pUnusedList)) { 288 288 (*ppTS) = list_entry(pUnusedList->next, 289 - struct ts_common_info, List); 290 - list_del_init(&(*ppTS)->List); 289 + struct ts_common_info, list); 290 + list_del_init(&(*ppTS)->list); 291 291 if (TxRxSelect == TX_DIR) { 292 292 struct tx_ts_record *tmp = 293 293 container_of(*ppTS, 294 294 struct tx_ts_record, 295 - TsCommonInfo); 295 + ts_common_info); 296 296 ResetTxTsEntry(tmp); 297 297 } else { 298 298 struct rx_ts_record *ts = ··· 305 305 netdev_dbg(ieee->dev, 306 306 "to init current TS, UP:%d, Dir:%d, addr: %pM ppTs=%p\n", 307 307 UP, Dir, addr, *ppTS); 308 - ts_info->ucTSID = UP; 308 + ts_info->ts_id = UP; 309 309 ts_info->ucDirection = Dir; 310 310 311 - MakeTSEntry(*ppTS, addr, &TSpec); 312 - list_add_tail(&((*ppTS)->List), pAddmitList); 311 + MakeTSEntry(*ppTS, addr, &tspec); 312 + list_add_tail(&((*ppTS)->list), pAddmitList); 313 313 314 314 return true; 315 315 } ··· 335 335 while (!list_empty(&ts->rx_pending_pkt_list)) { 336 336 pRxReorderEntry = (struct rx_reorder_entry *) 337 337 list_entry(ts->rx_pending_pkt_list.prev, 338 - struct rx_reorder_entry, List); 338 + struct rx_reorder_entry, list); 339 339 netdev_dbg(ieee->dev, "%s(): Delete SeqNum %d!\n", 340 340 __func__, pRxReorderEntry->SeqNum); 341 - list_del_init(&pRxReorderEntry->List); 341 + list_del_init(&pRxReorderEntry->list); 342 342 { 343 343 int i = 0; 344 344 struct rtllib_rxb *prxb = pRxReorderEntry->prxb; ··· 350 350 kfree(prxb); 351 351 prxb = NULL; 352 352 } 353 - list_add_tail(&pRxReorderEntry->List, 353 + list_add_tail(&pRxReorderEntry->list, 354 354 &ieee->RxReorder_Unused_List); 355 355 } 356 356 } else { 357 357 struct tx_ts_record *pTxTS = (struct tx_ts_record *)pTs; 358 358 359 - del_timer_sync(&pTxTS->TsAddBaTimer); 359 + del_timer_sync(&pTxTS->ts_add_ba_timer); 360 360 } 361 361 } 362 362 ··· 366 366 367 367 netdev_info(ieee->dev, "===========>%s, %pM\n", __func__, addr); 368 368 369 - list_for_each_entry_safe(ts, pTmpTS, &ieee->Tx_TS_Pending_List, List) { 369 + list_for_each_entry_safe(ts, pTmpTS, &ieee->Tx_TS_Pending_List, list) { 370 370 if (memcmp(ts->addr, addr, 6) == 0) { 371 371 RemoveTsEntry(ieee, ts, TX_DIR); 372 - list_del_init(&ts->List); 373 - list_add_tail(&ts->List, &ieee->Tx_TS_Unused_List); 372 + list_del_init(&ts->list); 373 + list_add_tail(&ts->list, &ieee->Tx_TS_Unused_List); 374 374 } 375 375 } 376 376 377 - list_for_each_entry_safe(ts, pTmpTS, &ieee->Tx_TS_Admit_List, List) { 377 + list_for_each_entry_safe(ts, pTmpTS, &ieee->Tx_TS_Admit_List, list) { 378 378 if (memcmp(ts->addr, addr, 6) == 0) { 379 379 netdev_info(ieee->dev, 380 380 "====>remove Tx_TS_admin_list\n"); 381 381 RemoveTsEntry(ieee, ts, TX_DIR); 382 - list_del_init(&ts->List); 383 - list_add_tail(&ts->List, &ieee->Tx_TS_Unused_List); 382 + list_del_init(&ts->list); 383 + list_add_tail(&ts->list, &ieee->Tx_TS_Unused_List); 384 384 } 385 385 } 386 386 387 - list_for_each_entry_safe(ts, pTmpTS, &ieee->Rx_TS_Pending_List, List) { 387 + list_for_each_entry_safe(ts, pTmpTS, &ieee->Rx_TS_Pending_List, list) { 388 388 if (memcmp(ts->addr, addr, 6) == 0) { 389 389 RemoveTsEntry(ieee, ts, RX_DIR); 390 - list_del_init(&ts->List); 391 - list_add_tail(&ts->List, &ieee->Rx_TS_Unused_List); 390 + list_del_init(&ts->list); 391 + list_add_tail(&ts->list, &ieee->Rx_TS_Unused_List); 392 392 } 393 393 } 394 394 395 - list_for_each_entry_safe(ts, pTmpTS, &ieee->Rx_TS_Admit_List, List) { 395 + list_for_each_entry_safe(ts, pTmpTS, &ieee->Rx_TS_Admit_List, list) { 396 396 if (memcmp(ts->addr, addr, 6) == 0) { 397 397 RemoveTsEntry(ieee, ts, RX_DIR); 398 - list_del_init(&ts->List); 399 - list_add_tail(&ts->List, &ieee->Rx_TS_Unused_List); 398 + list_del_init(&ts->list); 399 + list_add_tail(&ts->list, &ieee->Rx_TS_Unused_List); 400 400 } 401 401 } 402 402 } ··· 406 406 { 407 407 struct ts_common_info *ts, *pTmpTS; 408 408 409 - list_for_each_entry_safe(ts, pTmpTS, &ieee->Tx_TS_Pending_List, List) { 409 + list_for_each_entry_safe(ts, pTmpTS, &ieee->Tx_TS_Pending_List, list) { 410 410 RemoveTsEntry(ieee, ts, TX_DIR); 411 - list_del_init(&ts->List); 412 - list_add_tail(&ts->List, &ieee->Tx_TS_Unused_List); 411 + list_del_init(&ts->list); 412 + list_add_tail(&ts->list, &ieee->Tx_TS_Unused_List); 413 413 } 414 414 415 - list_for_each_entry_safe(ts, pTmpTS, &ieee->Tx_TS_Admit_List, List) { 415 + list_for_each_entry_safe(ts, pTmpTS, &ieee->Tx_TS_Admit_List, list) { 416 416 RemoveTsEntry(ieee, ts, TX_DIR); 417 - list_del_init(&ts->List); 418 - list_add_tail(&ts->List, &ieee->Tx_TS_Unused_List); 417 + list_del_init(&ts->list); 418 + list_add_tail(&ts->list, &ieee->Tx_TS_Unused_List); 419 419 } 420 420 421 - list_for_each_entry_safe(ts, pTmpTS, &ieee->Rx_TS_Pending_List, List) { 421 + list_for_each_entry_safe(ts, pTmpTS, &ieee->Rx_TS_Pending_List, list) { 422 422 RemoveTsEntry(ieee, ts, RX_DIR); 423 - list_del_init(&ts->List); 424 - list_add_tail(&ts->List, &ieee->Rx_TS_Unused_List); 423 + list_del_init(&ts->list); 424 + list_add_tail(&ts->list, &ieee->Rx_TS_Unused_List); 425 425 } 426 426 427 - list_for_each_entry_safe(ts, pTmpTS, &ieee->Rx_TS_Admit_List, List) { 427 + list_for_each_entry_safe(ts, pTmpTS, &ieee->Rx_TS_Admit_List, list) { 428 428 RemoveTsEntry(ieee, ts, RX_DIR); 429 - list_del_init(&ts->List); 430 - list_add_tail(&ts->List, &ieee->Rx_TS_Unused_List); 429 + list_del_init(&ts->list); 430 + list_add_tail(&ts->list, &ieee->Rx_TS_Unused_List); 431 431 } 432 432 } 433 433 434 434 void TsStartAddBaProcess(struct rtllib_device *ieee, struct tx_ts_record *pTxTS) 435 435 { 436 - if (pTxTS->bAddBaReqInProgress == false) { 437 - pTxTS->bAddBaReqInProgress = true; 436 + if (pTxTS->add_ba_req_in_progress == false) { 437 + pTxTS->add_ba_req_in_progress = true; 438 438 439 - if (pTxTS->bAddBaReqDelayed) { 439 + if (pTxTS->add_ba_req_delayed) { 440 440 netdev_dbg(ieee->dev, "Start ADDBA after 60 sec!!\n"); 441 - mod_timer(&pTxTS->TsAddBaTimer, jiffies + 441 + mod_timer(&pTxTS->ts_add_ba_timer, jiffies + 442 442 msecs_to_jiffies(TS_ADDBA_DELAY)); 443 443 } else { 444 444 netdev_dbg(ieee->dev, "Immediately Start ADDBA\n"); 445 - mod_timer(&pTxTS->TsAddBaTimer, jiffies + 10); 445 + mod_timer(&pTxTS->ts_add_ba_timer, jiffies + 10); 446 446 } 447 447 } else { 448 448 netdev_dbg(ieee->dev, "BA timer is already added\n");
+29 -42
drivers/staging/rtl8192e/rtllib.h
··· 103 103 /* Tx Desc Related flags (8-9) */ 104 104 u8 bLastIniPkt:1; 105 105 u8 bCmdOrInit:1; 106 - u8 bFirstSeg:1; 107 - u8 bLastSeg:1; 108 - u8 bEncrypt:1; 109 106 u8 tx_dis_rate_fallback:1; 110 107 u8 tx_use_drv_assinged_rate:1; 111 108 u8 bHwSec:1; ··· 114 117 u8 bRTSEnable:1; 115 118 u8 bUseShortGI:1; 116 119 u8 bUseShortPreamble:1; 117 - u8 bTxEnableFwCalcDur:1; 118 - u8 bAMPDUEnable:1; 120 + u8 tx_enable_fw_calc_dur:1; 121 + u8 ampdu_enable:1; 119 122 u8 bRTSSTBC:1; 120 123 u8 RTSSC:1; 121 124 ··· 136 139 u8 bAMSDU:1; 137 140 u8 bFromAggrQ:1; 138 141 u8 reserved6:6; 139 - u8 macId; 140 142 u8 priority; 141 143 142 144 /* Tx firmware related element(20-27) */ ··· 467 471 * any adverse affects. 468 472 */ 469 473 struct rtllib_rx_stats { 470 - u64 mac_time; 471 474 s8 rssi; 472 475 u8 signal; 473 476 u8 noise; ··· 1042 1047 #define REORDER_WIN_SIZE 128 1043 1048 #define REORDER_ENTRY_NUM 128 1044 1049 struct rx_reorder_entry { 1045 - struct list_head List; 1050 + struct list_head list; 1046 1051 u16 SeqNum; 1047 1052 struct rtllib_rxb *prxb; 1048 1053 }; ··· 1118 1123 u16 SlotNum; 1119 1124 u16 SlotIndex; 1120 1125 1121 - u32 NumTxOkInPeriod; 1122 - u32 NumRxOkInPeriod; 1126 + u32 num_tx_ok_in_period; 1127 + u32 num_rx_ok_in_period; 1123 1128 u32 NumRxUnicastOkInPeriod; 1124 1129 bool bBusyTraffic; 1125 1130 bool bHigherBusyTraffic; ··· 1164 1169 u8 Bssid[ETH_ALEN]; 1165 1170 u8 PMKID[16]; 1166 1171 u8 SsidBuf[33]; 1167 - u8 bUsed; 1172 + u8 used; 1168 1173 }; 1169 1174 1170 1175 /*************** DRIVER STATUS *****/ ··· 1187 1192 unsigned long status; 1188 1193 u8 CntAfterLink; 1189 1194 1190 - enum rt_op_mode OpMode; 1195 + enum rt_op_mode op_mode; 1191 1196 1192 1197 /* The last AssocReq/Resp IEs */ 1193 1198 u8 *assocreq_ies, *assocresp_ies; ··· 1219 1224 u8 HTHighestOperaRate; 1220 1225 u8 tx_dis_rate_fallback; 1221 1226 u8 tx_use_drv_assinged_rate; 1222 - u8 bTxEnableFwCalcDur; 1227 + u8 tx_enable_fw_calc_dur; 1223 1228 atomic_t atm_swbw; 1224 1229 1225 1230 struct list_head Tx_TS_Admit_List; 1226 1231 struct list_head Tx_TS_Pending_List; 1227 1232 struct list_head Tx_TS_Unused_List; 1228 - struct tx_ts_record TxTsRecord[TOTAL_TS_NUM]; 1233 + struct tx_ts_record tx_ts_records[TOTAL_TS_NUM]; 1229 1234 struct list_head Rx_TS_Admit_List; 1230 1235 struct list_head Rx_TS_Pending_List; 1231 1236 struct list_head Rx_TS_Unused_List; 1232 - struct rx_ts_record RxTsRecord[TOTAL_TS_NUM]; 1237 + struct rx_ts_record rx_ts_records[TOTAL_TS_NUM]; 1233 1238 struct rx_reorder_entry RxReorderEntry[128]; 1234 1239 struct list_head RxReorder_Unused_List; 1235 1240 ··· 1316 1321 u16 scan_watch_dog; 1317 1322 1318 1323 /* map of allowed channels. 0 is dummy */ 1319 - void *dot11d_info; 1320 - bool global_domain; 1321 1324 u8 active_channel_map[MAX_CHANNEL_NUMBER+1]; 1322 - 1323 - u8 bss_start_channel; 1324 1325 1325 1326 int rate; /* current rate */ 1326 1327 int basic_rate; ··· 1382 1391 int mgmt_queue_head; 1383 1392 int mgmt_queue_tail; 1384 1393 u8 AsocRetryCount; 1385 - struct sk_buff_head skb_waitQ[MAX_QUEUE_SIZE]; 1394 + struct sk_buff_head skb_waitq[MAX_QUEUE_SIZE]; 1386 1395 1387 1396 bool bdynamic_txpower_enable; 1388 1397 ··· 1402 1411 bool FwRWRF; 1403 1412 1404 1413 struct rt_link_detect link_detect_info; 1405 - bool bIsAggregateFrame; 1414 + bool is_aggregate_frame; 1406 1415 struct rt_pwr_save_ctrl pwr_save_ctrl; 1407 1416 1408 1417 /* used if IEEE_SOFTMAC_TX_QUEUE is set */ ··· 1412 1421 struct timer_list associate_timer; 1413 1422 1414 1423 /* used if IEEE_SOFTMAC_BEACONS is set */ 1415 - struct timer_list beacon_timer; 1416 1424 u8 need_sw_enc; 1417 1425 struct work_struct associate_complete_wq; 1418 1426 struct work_struct ips_leave_wq; ··· 1459 1469 * This function can sleep. the driver should ensure 1460 1470 * the radio has been switched before return. 1461 1471 */ 1462 - void (*set_chan)(struct net_device *dev, short ch); 1472 + void (*set_chan)(struct net_device *dev, u8 ch); 1463 1473 1464 1474 /* indicate the driver that the link state is changed 1465 1475 * for example it may indicate the card is associated now. ··· 1677 1687 void rtllib_start_protocol(struct rtllib_device *ieee); 1678 1688 void rtllib_stop_protocol(struct rtllib_device *ieee); 1679 1689 1680 - void rtllib_EnableNetMonitorMode(struct net_device *dev, bool bInitState); 1681 - void rtllib_DisableNetMonitorMode(struct net_device *dev, bool bInitState); 1690 + void rtllib_enable_net_monitor_mode(struct net_device *dev, bool init_state); 1691 + void rtllib_disable_net_monitor_mode(struct net_device *dev, bool init_state); 1682 1692 1683 1693 void rtllib_softmac_stop_protocol(struct rtllib_device *ieee); 1684 1694 void rtllib_softmac_start_protocol(struct rtllib_device *ieee); ··· 1686 1696 void rtllib_reset_queue(struct rtllib_device *ieee); 1687 1697 void rtllib_wake_all_queues(struct rtllib_device *ieee); 1688 1698 void rtllib_stop_all_queues(struct rtllib_device *ieee); 1689 - struct sk_buff *rtllib_get_beacon(struct rtllib_device *ieee); 1690 1699 1691 1700 void notify_wx_assoc_event(struct rtllib_device *ieee); 1692 1701 void rtllib_ps_tx_ack(struct rtllib_device *ieee, short success); ··· 1747 1758 union iwreq_data *wrqu, char *extra); 1748 1759 #define MAX_RECEIVE_BUFFER_SIZE 9100 1749 1760 1750 - void HTSetConnectBwMode(struct rtllib_device *ieee, 1761 + void ht_set_connect_bw_mode(struct rtllib_device *ieee, 1751 1762 enum ht_channel_width bandwidth, 1752 1763 enum ht_extchnl_offset Offset); 1753 1764 void ht_update_default_setting(struct rtllib_device *ieee); 1754 - void HTConstructCapabilityElement(struct rtllib_device *ieee, 1765 + void ht_construct_capability_element(struct rtllib_device *ieee, 1755 1766 u8 *posHTCap, u8 *len, 1756 1767 u8 isEncrypt, bool bAssoc); 1757 - void HTConstructInfoElement(struct rtllib_device *ieee, 1758 - u8 *posHTInfo, u8 *len, u8 isEncrypt); 1759 - void HTConstructRT2RTAggElement(struct rtllib_device *ieee, 1768 + void ht_construct_rt2rt_agg_element(struct rtllib_device *ieee, 1760 1769 u8 *posRT2RTAgg, u8 *len); 1761 - void HTOnAssocRsp(struct rtllib_device *ieee); 1762 - void HTInitializeHTInfo(struct rtllib_device *ieee); 1763 - void HTInitializeBssDesc(struct bss_ht *pBssHT); 1764 - void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee, 1770 + void ht_on_assoc_rsp(struct rtllib_device *ieee); 1771 + void ht_initialize_ht_info(struct rtllib_device *ieee); 1772 + void ht_initialize_bss_desc(struct bss_ht *pBssHT); 1773 + void ht_reset_self_and_save_peer_setting(struct rtllib_device *ieee, 1765 1774 struct rtllib_network *pNetwork); 1766 1775 void HT_update_self_and_peer_setting(struct rtllib_device *ieee, 1767 1776 struct rtllib_network *pNetwork); 1768 - u8 HTGetHighestMCSRate(struct rtllib_device *ieee, u8 *pMCSRateSet, 1777 + u8 ht_get_highest_mcs_rate(struct rtllib_device *ieee, u8 *pMCSRateSet, 1769 1778 u8 *pMCSFilter); 1770 1779 extern u8 MCS_FILTER_ALL[]; 1771 1780 extern u16 MCS_DATA_RATE[2][2][77]; 1772 - u8 HTCCheck(struct rtllib_device *ieee, u8 *pFrame); 1773 - void HTResetIOTSetting(struct rt_hi_throughput *ht_info); 1774 - bool IsHTHalfNmodeAPs(struct rtllib_device *ieee); 1775 - u16 TxCountToDataRate(struct rtllib_device *ieee, u8 nDataRate); 1781 + u8 ht_c_check(struct rtllib_device *ieee, u8 *pFrame); 1782 + void ht_reset_iot_setting(struct rt_hi_throughput *ht_info); 1783 + bool is_ht_half_nmode_aps(struct rtllib_device *ieee); 1784 + u16 tx_count_to_data_rate(struct rtllib_device *ieee, u8 nDataRate); 1776 1785 int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb); 1777 1786 int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb); 1778 1787 int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb); 1779 1788 void rtllib_ts_init_add_ba(struct rtllib_device *ieee, struct tx_ts_record *ts, 1780 - u8 policy, u8 bOverwritePending); 1789 + u8 policy, u8 overwrite_pending); 1781 1790 void rtllib_ts_init_del_ba(struct rtllib_device *ieee, 1782 - struct ts_common_info *pTsCommonInfo, 1791 + struct ts_common_info *ts_common_info, 1783 1792 enum tr_select TxRxSelect); 1784 1793 void rtllib_ba_setup_timeout(struct timer_list *t); 1785 1794 void rtllib_tx_ba_inact_timeout(struct timer_list *t);
+1 -1
drivers/staging/rtl8192e/rtllib_module.c
··· 123 123 goto free_softmac; 124 124 125 125 ht_update_default_setting(ieee); 126 - HTInitializeHTInfo(ieee); 126 + ht_initialize_ht_info(ieee); 127 127 rtllib_ts_init(ieee); 128 128 for (i = 0; i < IEEE_IBSS_MAC_HASH_SIZE; i++) 129 129 INIT_LIST_HEAD(&ieee->ibss_mac_hash[i]);
+25 -57
drivers/staging/rtl8192e/rtllib_rx.c
··· 34 34 #include <linux/ctype.h> 35 35 36 36 #include "rtllib.h" 37 - #include "dot11d.h" 38 37 39 38 static void rtllib_rx_mgt(struct rtllib_device *ieee, struct sk_buff *skb, 40 39 struct rtllib_rx_stats *stats); ··· 411 412 while (pList->next != &ts->rx_pending_pkt_list) { 412 413 if (SN_LESS(pReorderEntry->SeqNum, ((struct rx_reorder_entry *) 413 414 list_entry(pList->next, struct rx_reorder_entry, 414 - List))->SeqNum)) 415 + list))->SeqNum)) 415 416 pList = pList->next; 416 417 else if (SN_EQUAL(pReorderEntry->SeqNum, 417 418 ((struct rx_reorder_entry *)list_entry(pList->next, 418 - struct rx_reorder_entry, List))->SeqNum)) 419 + struct rx_reorder_entry, list))->SeqNum)) 419 420 return false; 420 421 else 421 422 break; 422 423 } 423 - pReorderEntry->List.next = pList->next; 424 - pReorderEntry->List.next->prev = &pReorderEntry->List; 425 - pReorderEntry->List.prev = pList; 426 - pList->next = &pReorderEntry->List; 424 + pReorderEntry->list.next = pList->next; 425 + pReorderEntry->list.next->prev = &pReorderEntry->list; 426 + pReorderEntry->list.prev = pList; 427 + pList->next = &pReorderEntry->list; 427 428 428 429 return true; 429 430 } ··· 504 505 505 506 pRxReorderEntry = (struct rx_reorder_entry *) 506 507 list_entry(ts->rx_pending_pkt_list.prev, 507 - struct rx_reorder_entry, List); 508 + struct rx_reorder_entry, list); 508 509 netdev_dbg(ieee->dev, "%s(): Indicate SeqNum %d!\n", __func__, 509 510 pRxReorderEntry->SeqNum); 510 - list_del_init(&pRxReorderEntry->List); 511 + list_del_init(&pRxReorderEntry->list); 511 512 512 513 ieee->RfdArray[RfdCnt] = pRxReorderEntry->prxb; 513 514 514 515 RfdCnt = RfdCnt + 1; 515 - list_add_tail(&pRxReorderEntry->List, 516 + list_add_tail(&pRxReorderEntry->list, 516 517 &ieee->RxReorder_Unused_List); 517 518 } 518 519 rtllib_indicate_packets(ieee, ieee->RfdArray, RfdCnt); ··· 601 602 if (!list_empty(&ieee->RxReorder_Unused_List)) { 602 603 pReorderEntry = (struct rx_reorder_entry *) 603 604 list_entry(ieee->RxReorder_Unused_List.next, 604 - struct rx_reorder_entry, List); 605 - list_del_init(&pReorderEntry->List); 605 + struct rx_reorder_entry, list); 606 + list_del_init(&pReorderEntry->list); 606 607 607 608 /* Make a reorder entry and insert 608 609 * into a the packet list. ··· 617 618 "%s(): Duplicate packet is dropped. IndicateSeq: %d, NewSeq: %d\n", 618 619 __func__, ts->rx_indicate_seq, 619 620 SeqNum); 620 - list_add_tail(&pReorderEntry->List, 621 + list_add_tail(&pReorderEntry->list, 621 622 &ieee->RxReorder_Unused_List); 622 623 623 624 for (i = 0; i < prxb->nr_subframes; i++) ··· 657 658 pReorderEntry = (struct rx_reorder_entry *) 658 659 list_entry(ts->rx_pending_pkt_list.prev, 659 660 struct rx_reorder_entry, 660 - List); 661 + list); 661 662 if (SN_LESS(pReorderEntry->SeqNum, ts->rx_indicate_seq) || 662 663 SN_EQUAL(pReorderEntry->SeqNum, ts->rx_indicate_seq)) { 663 664 /* This protect struct buffer from overflow. */ ··· 669 670 break; 670 671 } 671 672 672 - list_del_init(&pReorderEntry->List); 673 + list_del_init(&pReorderEntry->list); 673 674 674 675 if (SN_EQUAL(pReorderEntry->SeqNum, ts->rx_indicate_seq)) 675 676 ts->rx_indicate_seq = (ts->rx_indicate_seq + 1) % ··· 680 681 __func__, pReorderEntry->SeqNum); 681 682 index++; 682 683 683 - list_add_tail(&pReorderEntry->List, 684 + list_add_tail(&pReorderEntry->list, 684 685 &ieee->RxReorder_Unused_List); 685 686 } else { 686 687 bPktInBuf = true; ··· 730 731 731 732 u16 LLCOffset = sizeof(struct ieee80211_hdr_3addr); 732 733 u16 ChkLength; 733 - bool bIsAggregateFrame = false; 734 + bool is_aggregate_frame = false; 734 735 u16 nSubframe_Length; 735 736 u8 nPadding_Length = 0; 736 737 u16 SeqNum = 0; ··· 739 740 SeqNum = WLAN_GET_SEQ_SEQ(le16_to_cpu(hdr->seq_ctrl)); 740 741 if ((RTLLIB_QOS_HAS_SEQ(fc)) && 741 742 (((union frameqos *)(skb->data + RTLLIB_3ADDR_LEN))->field.reserved)) 742 - bIsAggregateFrame = true; 743 + is_aggregate_frame = true; 743 744 744 745 if (RTLLIB_QOS_HAS_SEQ(fc)) 745 746 LLCOffset += 2; ··· 752 753 return 0; 753 754 754 755 skb_pull(skb, LLCOffset); 755 - ieee->bIsAggregateFrame = bIsAggregateFrame; 756 - if (!bIsAggregateFrame) { 756 + ieee->is_aggregate_frame = is_aggregate_frame; 757 + if (!is_aggregate_frame) { 757 758 rxb->nr_subframes = 1; 758 759 759 760 /* altered by clark 3/30/2010 ··· 857 858 size_t hdrlen; 858 859 859 860 hdrlen = rtllib_get_hdrlen(fc); 860 - if (HTCCheck(ieee, skb->data)) { 861 + if (ht_c_check(ieee, skb->data)) { 861 862 if (net_ratelimit()) 862 863 netdev_info(ieee->dev, "%s: find HTCControl!\n", 863 864 __func__); ··· 1150 1151 if (unicast) { 1151 1152 if (ieee->link_state == MAC80211_LINKED) { 1152 1153 if (((ieee->link_detect_info.NumRxUnicastOkInPeriod + 1153 - ieee->link_detect_info.NumTxOkInPeriod) > 8) || 1154 + ieee->link_detect_info.num_tx_ok_in_period) > 8) || 1154 1155 (ieee->link_detect_info.NumRxUnicastOkInPeriod > 2)) { 1155 1156 ieee->leisure_ps_leave(ieee->dev); 1156 1157 } ··· 1285 1286 1286 1287 /* Update statstics for AP roaming */ 1287 1288 ieee->link_detect_info.NumRecvDataInPeriod++; 1288 - ieee->link_detect_info.NumRxOkInPeriod++; 1289 + ieee->link_detect_info.num_rx_ok_in_period++; 1289 1290 1290 1291 /* Data frame - extract src/dst addresses */ 1291 1292 rtllib_rx_extract_addr(ieee, hdr, dst, src, bssid); ··· 1358 1359 /* Update WAPI PN */ 1359 1360 1360 1361 /* Check if leave LPS */ 1361 - if (ieee->bIsAggregateFrame) 1362 + if (ieee->is_aggregate_frame) 1362 1363 nr_subframes = rxb->nr_subframes; 1363 1364 else 1364 1365 nr_subframes = 1; ··· 1401 1402 return 0; 1402 1403 } 1403 1404 1404 - if (HTCCheck(ieee, skb->data)) { 1405 + if (ht_c_check(ieee, skb->data)) { 1405 1406 if (net_ratelimit()) 1406 1407 netdev_info(ieee->dev, "%s: Find HTCControl!\n", 1407 1408 __func__); ··· 1659 1660 return "QOS_PARAMETER"; 1660 1661 default: 1661 1662 return "UNKNOWN"; 1662 - } 1663 - } 1664 - 1665 - static inline void rtllib_extract_country_ie( 1666 - struct rtllib_device *ieee, 1667 - struct rtllib_info_element *info_element, 1668 - struct rtllib_network *network, 1669 - u8 *addr2) 1670 - { 1671 - if (IS_DOT11D_ENABLE(ieee)) { 1672 - if (info_element->len != 0) { 1673 - memcpy(network->CountryIeBuf, info_element->data, 1674 - info_element->len); 1675 - network->CountryIeLen = info_element->len; 1676 - 1677 - if (!IS_COUNTRY_IE_VALID(ieee)) { 1678 - if (rtllib_act_scanning(ieee, false) && 1679 - ieee->FirstIe_InScan) 1680 - netdev_info(ieee->dev, 1681 - "Received beacon CountryIE, SSID: <%s>\n", 1682 - network->ssid); 1683 - dot11d_update_country(ieee, addr2, 1684 - info_element->len, 1685 - info_element->data); 1686 - } 1687 - } 1688 - 1689 - if (IS_EQUAL_CIE_SRC(ieee, addr2)) 1690 - UPDATE_CIE_WATCHDOG(ieee); 1691 1663 } 1692 1664 } 1693 1665 ··· 2116 2146 case MFIE_TYPE_COUNTRY: 2117 2147 netdev_dbg(ieee->dev, "MFIE_TYPE_COUNTRY: %d bytes\n", 2118 2148 info_element->len); 2119 - rtllib_extract_country_ie(ieee, info_element, network, 2120 - network->bssid); 2121 2149 break; 2122 2150 /* TODO */ 2123 2151 default: ··· 2189 2221 network->RSSI = stats->SignalStrength; 2190 2222 network->CountryIeLen = 0; 2191 2223 memset(network->CountryIeBuf, 0, MAX_IE_LEN); 2192 - HTInitializeBssDesc(&network->bssht); 2224 + ht_initialize_bss_desc(&network->bssht); 2193 2225 network->flags |= NETWORK_HAS_CCK; 2194 2226 2195 2227 network->wpa_ie_len = 0;
+60 -327
drivers/staging/rtl8192e/rtllib_softmac.c
··· 18 18 #include <linux/uaccess.h> 19 19 #include <linux/etherdevice.h> 20 20 #include <linux/ieee80211.h> 21 - #include "dot11d.h" 22 21 23 22 static void rtllib_sta_wakeup(struct rtllib_device *ieee, short nl); 24 23 ··· 44 45 * Then it updates the pointer so that 45 46 * it points after the new MFIE tag added. 46 47 */ 47 - static void rtllib_MFIE_Brate(struct rtllib_device *ieee, u8 **tag_p) 48 + static void rtllib_mfie_brate(struct rtllib_device *ieee, u8 **tag_p) 48 49 { 49 50 u8 *tag = *tag_p; 50 51 ··· 61 62 *tag_p = tag; 62 63 } 63 64 64 - static void rtllib_MFIE_Grate(struct rtllib_device *ieee, u8 **tag_p) 65 + static void rtllib_mfie_grate(struct rtllib_device *ieee, u8 **tag_p) 65 66 { 66 67 u8 *tag = *tag_p; 67 68 ··· 82 83 *tag_p = tag; 83 84 } 84 85 85 - static void rtllib_WMM_Info(struct rtllib_device *ieee, u8 **tag_p) 86 + static void rtllib_wmm_info(struct rtllib_device *ieee, u8 **tag_p) 86 87 { 87 88 u8 *tag = *tag_p; 88 89 ··· 98 99 *tag_p = tag; 99 100 } 100 101 101 - static void rtllib_TURBO_Info(struct rtllib_device *ieee, u8 **tag_p) 102 + static void rtllib_turbo_info(struct rtllib_device *ieee, u8 **tag_p) 102 103 { 103 104 u8 *tag = *tag_p; 104 105 ··· 134 135 135 136 static void init_mgmt_queue(struct rtllib_device *ieee) 136 137 { 137 - ieee->mgmt_queue_tail = ieee->mgmt_queue_head = 0; 138 + ieee->mgmt_queue_tail = 0; 139 + ieee->mgmt_queue_head = 0; 138 140 } 139 141 140 142 u8 MgntQuery_TxRateExcludeCCKRates(struct rtllib_device *ieee) 141 143 { 142 144 u16 i; 143 - u8 QueryRate = 0; 144 - u8 BasicRate; 145 + u8 query_rate = 0; 146 + u8 basic_rate; 145 147 146 148 for (i = 0; i < ieee->current_network.rates_len; i++) { 147 - BasicRate = ieee->current_network.rates[i] & 0x7F; 148 - if (!rtllib_is_cck_rate(BasicRate)) { 149 - if (QueryRate == 0) { 150 - QueryRate = BasicRate; 149 + basic_rate = ieee->current_network.rates[i] & 0x7F; 150 + if (!rtllib_is_cck_rate(basic_rate)) { 151 + if (query_rate == 0) { 152 + query_rate = basic_rate; 151 153 } else { 152 - if (BasicRate < QueryRate) 153 - QueryRate = BasicRate; 154 + if (basic_rate < query_rate) 155 + query_rate = basic_rate; 154 156 } 155 157 } 156 158 } 157 159 158 - if (QueryRate == 0) { 159 - QueryRate = 12; 160 - netdev_info(ieee->dev, "No BasicRate found!!\n"); 160 + if (query_rate == 0) { 161 + query_rate = 12; 162 + netdev_info(ieee->dev, "No basic_rate found!!\n"); 161 163 } 162 - return QueryRate; 164 + return query_rate; 163 165 } 164 166 165 167 static u8 MgntQuery_MgntFrameTxRate(struct rtllib_device *ieee) ··· 173 173 else 174 174 rate = ieee->basic_rate & 0x7f; 175 175 176 - if (rate == 0) { 177 - if (ieee->mode == WIRELESS_MODE_N_24G && !ht_info->bCurSuppCCK) 178 - rate = 0x0c; 179 - else 180 - rate = 0x02; 181 - } 176 + if (rate == 0) 177 + rate = 0x02; 182 178 183 179 return rate; 184 180 } ··· 236 240 /* check whether the managed packet queued greater than 5 */ 237 241 if (!ieee->check_nic_enough_desc(ieee->dev, 238 242 tcb_desc->queue_index) || 239 - skb_queue_len(&ieee->skb_waitQ[tcb_desc->queue_index]) || 243 + skb_queue_len(&ieee->skb_waitq[tcb_desc->queue_index]) || 240 244 ieee->queue_stop) { 241 245 /* insert the skb packet to the management queue 242 246 * ··· 246 250 netdev_info(ieee->dev, 247 251 "%s():insert to waitqueue, queue_index:%d!\n", 248 252 __func__, tcb_desc->queue_index); 249 - skb_queue_tail(&ieee->skb_waitQ[tcb_desc->queue_index], 253 + skb_queue_tail(&ieee->skb_waitq[tcb_desc->queue_index], 250 254 skb); 251 255 } else { 252 256 ieee->softmac_hard_start_xmit(skb, ieee->dev); ··· 341 345 memcpy(tag, ieee->current_network.ssid, len); 342 346 tag += len; 343 347 344 - rtllib_MFIE_Brate(ieee, &tag); 345 - rtllib_MFIE_Grate(ieee, &tag); 348 + rtllib_mfie_brate(ieee, &tag); 349 + rtllib_mfie_grate(ieee, &tag); 346 350 347 351 return skb; 348 352 } 349 353 350 - static struct sk_buff *rtllib_get_beacon_(struct rtllib_device *ieee); 351 - 352 - static void rtllib_send_beacon(struct rtllib_device *ieee) 353 - { 354 - struct sk_buff *skb; 355 - 356 - if (!ieee->ieee_up) 357 - return; 358 - skb = rtllib_get_beacon_(ieee); 359 - 360 - if (skb) { 361 - softmac_mgmt_xmit(skb, ieee); 362 - ieee->softmac_stats.tx_beacons++; 363 - } 364 - 365 - if (ieee->beacon_txing && ieee->ieee_up) 366 - mod_timer(&ieee->beacon_timer, jiffies + 367 - (msecs_to_jiffies(ieee->current_network.beacon_interval - 5))); 368 - } 369 - 370 - static void rtllib_send_beacon_cb(struct timer_list *t) 371 - { 372 - struct rtllib_device *ieee = 373 - from_timer(ieee, t, beacon_timer); 374 - unsigned long flags; 375 - 376 - spin_lock_irqsave(&ieee->beacon_lock, flags); 377 - rtllib_send_beacon(ieee); 378 - spin_unlock_irqrestore(&ieee->beacon_lock, flags); 379 - } 380 - 381 354 /* Enables network monitor mode, all rx packets will be received. */ 382 - void rtllib_EnableNetMonitorMode(struct net_device *dev, 383 - bool bInitState) 355 + void rtllib_enable_net_monitor_mode(struct net_device *dev, 356 + bool init_state) 384 357 { 385 358 struct rtllib_device *ieee = netdev_priv_rsl(dev); 386 359 387 360 netdev_info(dev, "========>Enter Monitor Mode\n"); 388 361 389 - ieee->AllowAllDestAddrHandler(dev, true, !bInitState); 362 + ieee->AllowAllDestAddrHandler(dev, true, !init_state); 390 363 } 391 364 392 365 /* Disables network monitor mode. Only packets destinated to 393 366 * us will be received. 394 367 */ 395 - void rtllib_DisableNetMonitorMode(struct net_device *dev, 396 - bool bInitState) 368 + void rtllib_disable_net_monitor_mode(struct net_device *dev, 369 + bool init_state) 397 370 { 398 371 struct rtllib_device *ieee = netdev_priv_rsl(dev); 399 372 400 373 netdev_info(dev, "========>Exit Monitor Mode\n"); 401 374 402 - ieee->AllowAllDestAddrHandler(dev, false, !bInitState); 375 + ieee->AllowAllDestAddrHandler(dev, false, !init_state); 403 376 } 404 377 405 378 static void rtllib_send_probe(struct rtllib_device *ieee) ··· 390 425 } 391 426 } 392 427 393 - static void rtllib_update_active_chan_map(struct rtllib_device *ieee) 394 - { 395 - memcpy(ieee->active_channel_map, GET_DOT11D_INFO(ieee)->channel_map, 396 - MAX_CHANNEL_NUMBER + 1); 397 - } 398 - 399 428 /* this performs syncro scan blocking the caller until all channels 400 429 * in the allowed channel map has been checked. 401 430 */ ··· 397 438 { 398 439 union iwreq_data wrqu; 399 440 short ch = 0; 400 - 401 - rtllib_update_active_chan_map(ieee); 402 441 403 442 ieee->be_scan_inprogress = true; 404 443 ··· 449 492 ieee->actscanning = false; 450 493 ieee->sync_scan_hurryup = 0; 451 494 452 - if (ieee->link_state >= MAC80211_LINKED) { 453 - if (IS_DOT11D_ENABLE(ieee)) 454 - dot11d_scan_complete(ieee); 455 - } 456 495 mutex_unlock(&ieee->scan_mutex); 457 496 458 497 ieee->be_scan_inprogress = false; ··· 462 509 struct rtllib_device *ieee = container_of_dwork_rsl(data, 463 510 struct rtllib_device, softmac_scan_wq); 464 511 u8 last_channel = ieee->current_network.channel; 465 - 466 - rtllib_update_active_chan_map(ieee); 467 512 468 513 if (!ieee->ieee_up) 469 514 return; ··· 503 552 return; 504 553 505 554 out: 506 - if (IS_DOT11D_ENABLE(ieee)) 507 - dot11d_scan_complete(ieee); 508 555 ieee->current_network.channel = last_channel; 509 556 510 557 out1: ··· 558 609 { 559 610 ieee->rtllib_ips_leave_wq(ieee->dev); 560 611 561 - if (IS_DOT11D_ENABLE(ieee)) { 562 - if (IS_COUNTRY_IE_VALID(ieee)) 563 - RESET_CIE_WATCHDOG(ieee); 564 - } 565 612 if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) { 566 613 if (ieee->scanning_continue == 0) { 567 614 ieee->actscanning = true; ··· 570 625 /* called with wx_mutex held */ 571 626 void rtllib_start_scan_syncro(struct rtllib_device *ieee) 572 627 { 573 - if (IS_DOT11D_ENABLE(ieee)) { 574 - if (IS_COUNTRY_IE_VALID(ieee)) 575 - RESET_CIE_WATCHDOG(ieee); 576 - } 577 628 ieee->sync_scan_hurryup = 0; 578 629 if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) 579 630 rtllib_softmac_scan_syncro(ieee); ··· 615 674 616 675 auth->status = cpu_to_le16(WLAN_STATUS_SUCCESS); 617 676 618 - return skb; 619 - } 620 - 621 - static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee, 622 - const u8 *dest) 623 - { 624 - u8 *tag; 625 - int beacon_size; 626 - struct rtllib_probe_response *beacon_buf; 627 - struct sk_buff *skb = NULL; 628 - int encrypt; 629 - int atim_len, erp_len; 630 - struct lib80211_crypt_data *crypt; 631 - 632 - char *ssid = ieee->current_network.ssid; 633 - int ssid_len = ieee->current_network.ssid_len; 634 - int rate_len = ieee->current_network.rates_len + 2; 635 - int rate_ex_len = ieee->current_network.rates_ex_len; 636 - int wpa_ie_len = ieee->wpa_ie_len; 637 - u8 erpinfo_content = 0; 638 - 639 - u8 *tmp_ht_cap_buf = NULL; 640 - u8 tmp_ht_cap_len = 0; 641 - u8 *tmp_ht_info_buf = NULL; 642 - u8 tmp_ht_info_len = 0; 643 - struct rt_hi_throughput *ht_info = ieee->ht_info; 644 - u8 *tmp_generic_ie_buf = NULL; 645 - u8 tmp_generic_ie_len = 0; 646 - 647 - if (rate_ex_len > 0) 648 - rate_ex_len += 2; 649 - 650 - if (ieee->current_network.capability & WLAN_CAPABILITY_IBSS) 651 - atim_len = 4; 652 - else 653 - atim_len = 0; 654 - 655 - if ((ieee->current_network.mode == WIRELESS_MODE_G) || 656 - (ieee->current_network.mode == WIRELESS_MODE_N_24G && 657 - ieee->ht_info->bCurSuppCCK)) { 658 - erp_len = 3; 659 - erpinfo_content = 0; 660 - if (ieee->current_network.buseprotection) 661 - erpinfo_content |= ERP_UseProtection; 662 - } else { 663 - erp_len = 0; 664 - } 665 - 666 - crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; 667 - encrypt = crypt && crypt->ops && 668 - ((strcmp(crypt->ops->name, "R-WEP") == 0 || wpa_ie_len)); 669 - if (ieee->ht_info->current_ht_support) { 670 - tmp_ht_cap_buf = (u8 *)&(ieee->ht_info->SelfHTCap); 671 - tmp_ht_cap_len = sizeof(ieee->ht_info->SelfHTCap); 672 - tmp_ht_info_buf = (u8 *)&(ieee->ht_info->SelfHTInfo); 673 - tmp_ht_info_len = sizeof(ieee->ht_info->SelfHTInfo); 674 - HTConstructCapabilityElement(ieee, tmp_ht_cap_buf, 675 - &tmp_ht_cap_len, encrypt, false); 676 - HTConstructInfoElement(ieee, tmp_ht_info_buf, &tmp_ht_info_len, 677 - encrypt); 678 - 679 - if (ht_info->reg_rt2rt_aggregation) { 680 - tmp_generic_ie_buf = ieee->ht_info->sz_rt2rt_agg_buf; 681 - tmp_generic_ie_len = 682 - sizeof(ieee->ht_info->sz_rt2rt_agg_buf); 683 - HTConstructRT2RTAggElement(ieee, tmp_generic_ie_buf, 684 - &tmp_generic_ie_len); 685 - } 686 - } 687 - 688 - beacon_size = sizeof(struct rtllib_probe_response) + 2 + 689 - ssid_len + 3 + rate_len + rate_ex_len + atim_len + erp_len 690 - + wpa_ie_len + ieee->tx_headroom; 691 - skb = dev_alloc_skb(beacon_size); 692 - if (!skb) 693 - return NULL; 694 - 695 - skb_reserve(skb, ieee->tx_headroom); 696 - 697 - beacon_buf = skb_put(skb, (beacon_size - ieee->tx_headroom)); 698 - ether_addr_copy(beacon_buf->header.addr1, dest); 699 - ether_addr_copy(beacon_buf->header.addr2, ieee->dev->dev_addr); 700 - ether_addr_copy(beacon_buf->header.addr3, ieee->current_network.bssid); 701 - 702 - beacon_buf->header.duration_id = 0; 703 - beacon_buf->beacon_interval = 704 - cpu_to_le16(ieee->current_network.beacon_interval); 705 - beacon_buf->capability = 706 - cpu_to_le16(ieee->current_network.capability & 707 - WLAN_CAPABILITY_IBSS); 708 - beacon_buf->capability |= 709 - cpu_to_le16(ieee->current_network.capability & 710 - WLAN_CAPABILITY_SHORT_PREAMBLE); 711 - 712 - if (ieee->current_network.capability & WLAN_CAPABILITY_SHORT_SLOT_TIME) 713 - beacon_buf->capability |= 714 - cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME); 715 - 716 - crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; 717 - if (encrypt) 718 - beacon_buf->capability |= cpu_to_le16(WLAN_CAPABILITY_PRIVACY); 719 - 720 - beacon_buf->header.frame_control = cpu_to_le16(IEEE80211_STYPE_PROBE_RESP); 721 - beacon_buf->info_element[0].id = MFIE_TYPE_SSID; 722 - beacon_buf->info_element[0].len = ssid_len; 723 - 724 - tag = (u8 *)beacon_buf->info_element[0].data; 725 - 726 - memcpy(tag, ssid, ssid_len); 727 - 728 - tag += ssid_len; 729 - 730 - *(tag++) = MFIE_TYPE_RATES; 731 - *(tag++) = rate_len - 2; 732 - memcpy(tag, ieee->current_network.rates, rate_len - 2); 733 - tag += rate_len - 2; 734 - 735 - *(tag++) = MFIE_TYPE_DS_SET; 736 - *(tag++) = 1; 737 - *(tag++) = ieee->current_network.channel; 738 - 739 - if (atim_len) { 740 - u16 val16; 741 - *(tag++) = MFIE_TYPE_IBSS_SET; 742 - *(tag++) = 2; 743 - val16 = ieee->current_network.atim_window; 744 - memcpy((u8 *)tag, (u8 *)&val16, 2); 745 - tag += 2; 746 - } 747 - 748 - if (erp_len) { 749 - *(tag++) = MFIE_TYPE_ERP; 750 - *(tag++) = 1; 751 - *(tag++) = erpinfo_content; 752 - } 753 - if (rate_ex_len) { 754 - *(tag++) = MFIE_TYPE_RATES_EX; 755 - *(tag++) = rate_ex_len - 2; 756 - memcpy(tag, ieee->current_network.rates_ex, rate_ex_len - 2); 757 - tag += rate_ex_len - 2; 758 - } 759 - 760 - if (wpa_ie_len) { 761 - memcpy(tag, ieee->wpa_ie, ieee->wpa_ie_len); 762 - tag += ieee->wpa_ie_len; 763 - } 764 677 return skb; 765 678 } 766 679 ··· 670 875 int i = 0; 671 876 672 877 do { 673 - if ((ieee->PMKIDList[i].bUsed) && 878 + if ((ieee->PMKIDList[i].used) && 674 879 (memcmp(ieee->PMKIDList[i].Bssid, bssid, ETH_ALEN) == 0)) 675 880 break; 676 881 i++; ··· 728 933 } 729 934 730 935 if (ieee->ht_info->current_ht_support && ieee->ht_info->enable_ht) { 731 - ht_cap_buf = (u8 *)&(ieee->ht_info->SelfHTCap); 936 + ht_cap_buf = (u8 *)&ieee->ht_info->SelfHTCap; 732 937 ht_cap_len = sizeof(ieee->ht_info->SelfHTCap); 733 - HTConstructCapabilityElement(ieee, ht_cap_buf, &ht_cap_len, 938 + ht_construct_capability_element(ieee, ht_cap_buf, &ht_cap_len, 734 939 encrypt, true); 735 940 if (ieee->ht_info->current_rt2rt_aggregation) { 736 941 realtek_ie_buf = ieee->ht_info->sz_rt2rt_agg_buf; 737 942 realtek_ie_len = 738 943 sizeof(ieee->ht_info->sz_rt2rt_agg_buf); 739 - HTConstructRT2RTAggElement(ieee, realtek_ie_buf, 944 + ht_construct_rt2rt_agg_element(ieee, realtek_ie_buf, 740 945 &realtek_ie_len); 741 946 } 742 947 } ··· 866 1071 tag += osCcxVerNum.Length; 867 1072 } 868 1073 if (ieee->ht_info->current_ht_support && ieee->ht_info->enable_ht) { 869 - if (ieee->ht_info->ePeerHTSpecVer != HT_SPEC_VER_EWC) { 1074 + if (ieee->ht_info->peer_ht_spec_ver != HT_SPEC_VER_EWC) { 870 1075 tag = skb_put(skb, ht_cap_len); 871 1076 *tag++ = MFIE_TYPE_HT_CAP; 872 1077 *tag++ = ht_cap_len - 2; ··· 888 1093 } 889 1094 if (wmm_info_len) { 890 1095 tag = skb_put(skb, wmm_info_len); 891 - rtllib_WMM_Info(ieee, &tag); 1096 + rtllib_wmm_info(ieee, &tag); 892 1097 } 893 1098 894 1099 if (wps_ie_len && ieee->wps_ie) ··· 896 1101 897 1102 if (turbo_info_len) { 898 1103 tag = skb_put(skb, turbo_info_len); 899 - rtllib_TURBO_Info(ieee, &tag); 1104 + rtllib_turbo_info(ieee, &tag); 900 1105 } 901 1106 902 1107 if (ieee->ht_info->current_ht_support && ieee->ht_info->enable_ht) { 903 - if (ieee->ht_info->ePeerHTSpecVer == HT_SPEC_VER_EWC) { 1108 + if (ieee->ht_info->peer_ht_spec_ver == HT_SPEC_VER_EWC) { 904 1109 tag = skb_put(skb, ht_cap_len); 905 1110 *tag++ = MFIE_TYPE_GENERIC; 906 1111 *tag++ = ht_cap_len - 2; ··· 918 1123 919 1124 kfree(ieee->assocreq_ies); 920 1125 ieee->assocreq_ies = NULL; 921 - ies = &(hdr->info_element[0].id); 1126 + ies = &hdr->info_element[0].id; 922 1127 ieee->assocreq_ies_len = (skb->data + skb->len) - ies; 923 1128 ieee->assocreq_ies = kmemdup(ies, ieee->assocreq_ies_len, GFP_ATOMIC); 924 1129 if (!ieee->assocreq_ies) ··· 1064 1269 } 1065 1270 if (ieee->ht_info->current_ht_support && ieee->ht_info->enable_ht) { 1066 1271 netdev_info(ieee->dev, "Successfully associated, ht enabled\n"); 1067 - HTOnAssocRsp(ieee); 1272 + ht_on_assoc_rsp(ieee); 1068 1273 } else { 1069 1274 netdev_info(ieee->dev, 1070 1275 "Successfully associated, ht not enabled(%d, %d)\n", ··· 1109 1314 mutex_lock(&ieee->wx_mutex); 1110 1315 1111 1316 rtllib_stop_scan(ieee); 1112 - HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); 1317 + ht_set_connect_bw_mode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); 1113 1318 if (ieee->rf_power_state == rf_off) { 1114 1319 ieee->rtllib_ips_leave_wq(ieee->dev); 1115 1320 mutex_unlock(&ieee->wx_mutex); ··· 1212 1417 !(ieee->softmac_features & IEEE_SOFTMAC_SCAN)) 1213 1418 rtllib_stop_scan_syncro(ieee); 1214 1419 1215 - HTResetIOTSetting(ieee->ht_info); 1420 + ht_reset_iot_setting(ieee->ht_info); 1216 1421 ieee->wmm_acm = 0; 1217 1422 if (ieee->iw_mode == IW_MODE_INFRA) { 1218 1423 /* Join the network for the first time */ 1219 1424 ieee->AsocRetryCount = 0; 1220 1425 if ((ieee->current_network.qos_data.supported == 1) && 1221 1426 ieee->current_network.bssht.bd_support_ht) 1222 - HTResetSelfAndSavePeerSetting(ieee, 1427 + ht_reset_self_and_save_peer_setting(ieee, 1223 1428 &(ieee->current_network)); 1224 1429 else 1225 1430 ieee->ht_info->current_ht_support = false; 1226 1431 1227 1432 ieee->link_state = RTLLIB_ASSOCIATING; 1228 - schedule_delayed_work( 1229 - &ieee->associate_procedure_wq, 0); 1433 + schedule_delayed_work(&ieee->associate_procedure_wq, 0); 1230 1434 } else { 1231 1435 if (rtllib_is_54g(&ieee->current_network)) { 1232 1436 ieee->rate = 108; ··· 1619 1825 1620 1826 kfree(ieee->assocresp_ies); 1621 1827 ieee->assocresp_ies = NULL; 1622 - ies = &(assoc_resp->info_element[0].id); 1828 + ies = &assoc_resp->info_element[0].id; 1623 1829 ieee->assocresp_ies_len = (skb->data + skb->len) - ies; 1624 1830 ieee->assocresp_ies = kmemdup(ies, 1625 1831 ieee->assocresp_ies_len, ··· 1635 1841 "Association response status code 0x%x\n", 1636 1842 errcode); 1637 1843 if (ieee->AsocRetryCount < RT_ASOC_RETRY_LIMIT) 1638 - schedule_delayed_work( 1639 - &ieee->associate_procedure_wq, 0); 1844 + schedule_delayed_work(&ieee->associate_procedure_wq, 0); 1640 1845 else 1641 1846 rtllib_associate_abort(ieee); 1642 1847 } ··· 1665 1872 ieee->softmac_stats.rx_auth_rs_ok++; 1666 1873 if (!(ieee->ht_info->iot_action & HT_IOT_ACT_PURE_N_MODE)) { 1667 1874 if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) { 1668 - if (IsHTHalfNmodeAPs(ieee)) { 1875 + if (is_ht_half_nmode_aps(ieee)) { 1669 1876 bSupportNmode = true; 1670 1877 bHalfSupportNmode = true; 1671 1878 } else { ··· 1823 2030 * the wait queue 1824 2031 */ 1825 2032 for (i = 0; i < txb->nr_frags; i++) { 1826 - queue_len = skb_queue_len(&ieee->skb_waitQ[queue_index]); 2033 + queue_len = skb_queue_len(&ieee->skb_waitq[queue_index]); 1827 2034 if ((queue_len != 0) || 1828 2035 (!ieee->check_nic_enough_desc(ieee->dev, queue_index)) || 1829 2036 (ieee->queue_stop)) { ··· 1832 2039 * to check it any more. 1833 2040 */ 1834 2041 if (queue_len < 200) 1835 - skb_queue_tail(&ieee->skb_waitQ[queue_index], 2042 + skb_queue_tail(&ieee->skb_waitq[queue_index], 1836 2043 txb->fragments[i]); 1837 2044 else 1838 2045 kfree_skb(txb->fragments[i]); 1839 2046 } else { 1840 - ieee->softmac_data_hard_start_xmit( 1841 - txb->fragments[i], 2047 + ieee->softmac_data_hard_start_xmit(txb->fragments[i], 1842 2048 ieee->dev, ieee->rate); 1843 2049 } 1844 2050 } ··· 1882 2090 { 1883 2091 unsigned long flags; 1884 2092 1885 - if (IS_DOT11D_ENABLE(ieee) && !IS_COUNTRY_IE_VALID(ieee)) { 1886 - if (!ieee->global_domain) 1887 - return; 1888 - } 1889 2093 /* check if we have already found the net we 1890 2094 * are interested in (if any). 1891 2095 * if not (we are disassociated and we are not ··· 1909 2121 struct rtllib_device, link_change_wq); 1910 2122 ieee->link_change(ieee->dev); 1911 2123 } 2124 + 1912 2125 /* called only in userspace context */ 1913 2126 void rtllib_disassociate(struct rtllib_device *ieee) 1914 2127 { ··· 1917 2128 if (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE) 1918 2129 rtllib_reset_queue(ieee); 1919 2130 1920 - if (IS_DOT11D_ENABLE(ieee)) 1921 - dot11d_reset(ieee); 1922 2131 ieee->link_state = MAC80211_NOLINK; 1923 2132 ieee->is_set_key = false; 1924 2133 ieee->wap_set = 0; ··· 1967 2180 exit: 1968 2181 mutex_unlock(&ieee->wx_mutex); 1969 2182 } 1970 - 1971 - static struct sk_buff *rtllib_get_beacon_(struct rtllib_device *ieee) 1972 - { 1973 - static const u8 broadcast_addr[] = { 1974 - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff 1975 - }; 1976 - struct sk_buff *skb; 1977 - struct rtllib_probe_response *b; 1978 - 1979 - skb = rtllib_probe_resp(ieee, broadcast_addr); 1980 - 1981 - if (!skb) 1982 - return NULL; 1983 - 1984 - b = (struct rtllib_probe_response *)skb->data; 1985 - b->header.frame_control = cpu_to_le16(IEEE80211_STYPE_BEACON); 1986 - 1987 - return skb; 1988 - } 1989 - 1990 - struct sk_buff *rtllib_get_beacon(struct rtllib_device *ieee) 1991 - { 1992 - struct sk_buff *skb; 1993 - struct rtllib_probe_response *b; 1994 - 1995 - skb = rtllib_get_beacon_(ieee); 1996 - if (!skb) 1997 - return NULL; 1998 - 1999 - b = (struct rtllib_probe_response *)skb->data; 2000 - b->header.seq_ctrl = cpu_to_le16(ieee->seq_ctrl[0] << 4); 2001 - 2002 - if (ieee->seq_ctrl[0] == 0xFFF) 2003 - ieee->seq_ctrl[0] = 0; 2004 - else 2005 - ieee->seq_ctrl[0]++; 2006 - 2007 - return skb; 2008 - } 2009 - EXPORT_SYMBOL(rtllib_get_beacon); 2010 2183 2011 2184 void rtllib_softmac_stop_protocol(struct rtllib_device *ieee) 2012 2185 { ··· 2026 2279 short ch = 0; 2027 2280 int i = 0; 2028 2281 2029 - rtllib_update_active_chan_map(ieee); 2030 - 2031 2282 if (ieee->proto_started) 2032 2283 return; 2033 2284 ··· 2071 2326 ieee->link_state = MAC80211_NOLINK; 2072 2327 for (i = 0; i < 5; i++) 2073 2328 ieee->seq_ctrl[i] = 0; 2074 - ieee->dot11d_info = kzalloc(sizeof(struct rt_dot11d_info), GFP_ATOMIC); 2075 - if (!ieee->dot11d_info) 2076 - return -ENOMEM; 2077 2329 2078 2330 ieee->link_detect_info.SlotIndex = 0; 2079 2331 ieee->link_detect_info.SlotNum = 2; 2080 2332 ieee->link_detect_info.NumRecvBcnInPeriod = 0; 2081 2333 ieee->link_detect_info.NumRecvDataInPeriod = 0; 2082 - ieee->link_detect_info.NumTxOkInPeriod = 0; 2083 - ieee->link_detect_info.NumRxOkInPeriod = 0; 2334 + ieee->link_detect_info.num_tx_ok_in_period = 0; 2335 + ieee->link_detect_info.num_rx_ok_in_period = 0; 2084 2336 ieee->link_detect_info.NumRxUnicastOkInPeriod = 0; 2085 - ieee->bIsAggregateFrame = false; 2337 + ieee->is_aggregate_frame = false; 2086 2338 ieee->assoc_id = 0; 2087 2339 ieee->queue_stop = 0; 2088 2340 ieee->scanning_continue = 0; ··· 2110 2368 ieee->tx_pending.txb = NULL; 2111 2369 2112 2370 timer_setup(&ieee->associate_timer, rtllib_associate_abort_cb, 0); 2113 - 2114 - timer_setup(&ieee->beacon_timer, rtllib_send_beacon_cb, 0); 2115 2371 2116 2372 INIT_DELAYED_WORK(&ieee->link_change_wq, (void *)rtllib_link_change_wq); 2117 2373 INIT_WORK(&ieee->associate_complete_wq, (void *)rtllib_associate_complete_wq); ··· 2144 2404 cancel_work_sync(&ieee->ips_leave_wq); 2145 2405 cancel_work_sync(&ieee->wx_sync_scan_wq); 2146 2406 cancel_work_sync(&ieee->ps_task); 2147 - 2148 - kfree(ieee->dot11d_info); 2149 - ieee->dot11d_info = NULL; 2150 2407 } 2151 2408 2152 2409 static inline struct sk_buff * ··· 2230 2493 return SEC_ALG_WEP; 2231 2494 } else if ((wpa_ie_len != 0)) { 2232 2495 if (((ieee->wpa_ie[0] == 0xdd) && 2233 - (!memcmp(&(ieee->wpa_ie[14]), ccmp_ie, 4))) || 2496 + (!memcmp(&ieee->wpa_ie[14], ccmp_ie, 4))) || 2234 2497 ((ieee->wpa_ie[0] == 0x30) && 2235 2498 (!memcmp(&ieee->wpa_ie[10], ccmp_rsn_ie, 4)))) 2236 2499 return SEC_ALG_CCMP; ··· 2245 2508 u8 *asSta, u8 asRsn) 2246 2509 { 2247 2510 u8 i; 2248 - u8 OpMode; 2511 + u8 op_mode; 2249 2512 2250 2513 RemovePeerTS(rtllib, asSta); 2251 2514 ··· 2254 2517 2255 2518 for (i = 0; i < 6; i++) 2256 2519 rtllib->current_network.bssid[i] = 0x22; 2257 - OpMode = RT_OP_MODE_NO_LINK; 2258 - rtllib->OpMode = RT_OP_MODE_NO_LINK; 2520 + op_mode = RT_OP_MODE_NO_LINK; 2521 + rtllib->op_mode = RT_OP_MODE_NO_LINK; 2259 2522 rtllib->SetHwRegHandler(rtllib->dev, HW_VAR_MEDIA_STATUS, 2260 - (u8 *)(&OpMode)); 2523 + (u8 *)(&op_mode)); 2261 2524 rtllib_disassociate(rtllib); 2262 2525 2263 2526 rtllib->SetHwRegHandler(rtllib->dev, HW_VAR_BSSID, ··· 2265 2528 } 2266 2529 } 2267 2530 2268 - static void 2269 - rtllib_MgntDisconnectAP( 2270 - struct rtllib_device *rtllib, 2271 - u8 asRsn 2272 - ) 2531 + static void rtllib_MgntDisconnectAP(struct rtllib_device *rtllib, u8 asRsn) 2273 2532 { 2274 2533 bool bFilterOutNonAssociatedBSSID = false; 2275 2534
+5 -6
drivers/staging/rtl8192e/rtllib_softmac_wx.c
··· 14 14 #include <linux/etherdevice.h> 15 15 16 16 #include "rtllib.h" 17 - #include "dot11d.h" 18 17 19 18 int rtllib_wx_set_freq(struct rtllib_device *ieee, struct iw_request_info *a, 20 19 union iwreq_data *wrqu, char *b) ··· 207 208 { 208 209 u32 tmp_rate; 209 210 210 - tmp_rate = TxCountToDataRate(ieee, 211 + tmp_rate = tx_count_to_data_rate(ieee, 211 212 ieee->softmac_stats.CurrentShowTxate); 212 213 wrqu->bitrate.value = tmp_rate * 500000; 213 214 ··· 266 267 267 268 if (wrqu->mode == IW_MODE_MONITOR) { 268 269 ieee->dev->type = ARPHRD_IEEE80211; 269 - rtllib_EnableNetMonitorMode(ieee->dev, false); 270 + rtllib_enable_net_monitor_mode(ieee->dev, false); 270 271 } else { 271 272 ieee->dev->type = ARPHRD_ETHER; 272 273 if (ieee->iw_mode == IW_MODE_MONITOR) 273 - rtllib_DisableNetMonitorMode(ieee->dev, false); 274 + rtllib_disable_net_monitor_mode(ieee->dev, false); 274 275 } 275 276 276 277 if (!ieee->proto_started) { ··· 317 318 ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_BACKUP); 318 319 319 320 if (ieee->ht_info->current_ht_support && ieee->ht_info->enable_ht && 320 - ieee->ht_info->bCurBW40MHz) { 321 + ieee->ht_info->cur_bw_40mhz) { 321 322 b40M = 1; 322 323 chan_offset = ieee->ht_info->CurSTAExtChnlOffset; 323 - bandwidth = (enum ht_channel_width)ieee->ht_info->bCurBW40MHz; 324 + bandwidth = (enum ht_channel_width)ieee->ht_info->cur_bw_40mhz; 324 325 ieee->set_bw_mode_handler(ieee->dev, HT_CHANNEL_WIDTH_20, 325 326 HT_EXTCHNL_OFFSET_NO_EXT); 326 327 }
+22 -44
drivers/staging/rtl8192e/rtllib_tx.c
··· 267 267 struct cb_desc *tcb_desc) 268 268 { 269 269 struct rt_hi_throughput *ht_info = ieee->ht_info; 270 - struct tx_ts_record *pTxTs = NULL; 270 + struct tx_ts_record *ts = NULL; 271 271 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 272 272 273 273 if (rtllib_act_scanning(ieee, false)) ··· 288 288 289 289 if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) 290 290 return; 291 - if (ht_info->bCurrentAMPDUEnable) { 292 - if (!rtllib_get_ts(ieee, (struct ts_common_info **)(&pTxTs), hdr->addr1, 291 + if (ht_info->current_ampdu_enable) { 292 + if (!rtllib_get_ts(ieee, (struct ts_common_info **)(&ts), hdr->addr1, 293 293 skb->priority, TX_DIR, true)) { 294 294 netdev_info(ieee->dev, "%s: can't get TS\n", __func__); 295 295 return; 296 296 } 297 - if (!pTxTs->TxAdmittedBARecord.b_valid) { 297 + if (!ts->tx_admitted_ba_record.b_valid) { 298 298 if (ieee->wpa_ie_len && (ieee->pairwise_key_type == 299 299 KEY_TYPE_NA)) { 300 300 ; 301 301 } else if (tcb_desc->bdhcp == 1) { 302 302 ; 303 - } else if (!pTxTs->bDisable_AddBa) { 304 - TsStartAddBaProcess(ieee, pTxTs); 303 + } else if (!ts->disable_add_ba) { 304 + TsStartAddBaProcess(ieee, ts); 305 305 } 306 - goto FORCED_AGG_SETTING; 307 - } else if (!pTxTs->bUsingBa) { 308 - if (SN_LESS(pTxTs->TxAdmittedBARecord.ba_start_seq_ctrl.field.seq_num, 309 - (pTxTs->TxCurSeq + 1) % 4096)) 310 - pTxTs->bUsingBa = true; 306 + return; 307 + } else if (!ts->using_ba) { 308 + if (SN_LESS(ts->tx_admitted_ba_record.ba_start_seq_ctrl.field.seq_num, 309 + (ts->tx_cur_seq + 1) % 4096)) 310 + ts->using_ba = true; 311 311 else 312 - goto FORCED_AGG_SETTING; 312 + return; 313 313 } 314 314 if (ieee->iw_mode == IW_MODE_INFRA) { 315 - tcb_desc->bAMPDUEnable = true; 315 + tcb_desc->ampdu_enable = true; 316 316 tcb_desc->ampdu_factor = ht_info->CurrentAMPDUFactor; 317 317 tcb_desc->ampdu_density = ht_info->current_mpdu_density; 318 318 } 319 - } 320 - FORCED_AGG_SETTING: 321 - switch (ht_info->ForcedAMPDUMode) { 322 - case HT_AGG_AUTO: 323 - break; 324 - 325 - case HT_AGG_FORCE_ENABLE: 326 - tcb_desc->bAMPDUEnable = true; 327 - tcb_desc->ampdu_density = ht_info->forced_mpdu_density; 328 - tcb_desc->ampdu_factor = ht_info->forced_ampdu_factor; 329 - break; 330 - 331 - case HT_AGG_FORCE_DISABLE: 332 - tcb_desc->bAMPDUEnable = false; 333 - tcb_desc->ampdu_density = 0; 334 - tcb_desc->ampdu_factor = 0; 335 - break; 336 319 } 337 320 } 338 321 ··· 340 357 if (!ht_info->current_ht_support || !ht_info->enable_ht) 341 358 return; 342 359 343 - if (ht_info->forced_short_gi) { 360 + if (ht_info->cur_bw_40mhz && ht_info->cur_short_gi_40mhz) 344 361 tcb_desc->bUseShortGI = true; 345 - return; 346 - } 347 - 348 - if (ht_info->bCurBW40MHz && ht_info->bCurShortGI40MHz) 349 - tcb_desc->bUseShortGI = true; 350 - else if (!ht_info->bCurBW40MHz && ht_info->bCurShortGI20MHz) 362 + else if (!ht_info->cur_bw_40mhz && ht_info->cur_short_gi_20mhz) 351 363 tcb_desc->bUseShortGI = true; 352 364 } 353 365 ··· 361 383 362 384 if ((tcb_desc->data_rate & 0x80) == 0) 363 385 return; 364 - if (ht_info->bCurBW40MHz && ht_info->cur_tx_bw40mhz && 386 + if (ht_info->cur_bw_40mhz && ht_info->cur_tx_bw40mhz && 365 387 !ieee->bandwidth_auto_switch.bforced_tx20Mhz) 366 388 tcb_desc->bPacketBW = true; 367 389 } ··· 419 441 if (ht_info->current_ht_support && ht_info->enable_ht) { 420 442 u8 HTOpMode = ht_info->current_op_mode; 421 443 422 - if ((ht_info->bCurBW40MHz && (HTOpMode == 2 || 444 + if ((ht_info->cur_bw_40mhz && (HTOpMode == 2 || 423 445 HTOpMode == 3)) || 424 - (!ht_info->bCurBW40MHz && HTOpMode == 3)) { 446 + (!ht_info->cur_bw_40mhz && HTOpMode == 3)) { 425 447 tcb_desc->rts_rate = MGN_24M; 426 448 tcb_desc->bRTSEnable = true; 427 449 break; ··· 432 454 tcb_desc->bRTSEnable = true; 433 455 break; 434 456 } 435 - if (tcb_desc->bAMPDUEnable) { 457 + if (tcb_desc->ampdu_enable) { 436 458 tcb_desc->rts_rate = MGN_24M; 437 459 tcb_desc->bRTSEnable = false; 438 460 break; ··· 478 500 if (!rtllib_get_ts(ieee, (struct ts_common_info **)(&ts), dst, 479 501 skb->priority, TX_DIR, true)) 480 502 return 0; 481 - seqnum = ts->TxCurSeq; 482 - ts->TxCurSeq = (ts->TxCurSeq + 1) % 4096; 503 + seqnum = ts->tx_cur_seq; 504 + ts->tx_cur_seq = (ts->tx_cur_seq + 1) % 4096; 483 505 return seqnum; 484 506 } 485 507 return 0; ··· 825 847 if (txb) { 826 848 tcb_desc = (struct cb_desc *) 827 849 (txb->fragments[0]->cb + MAX_DEV_ADDR_SIZE); 828 - tcb_desc->bTxEnableFwCalcDur = 1; 850 + tcb_desc->tx_enable_fw_calc_dur = 1; 829 851 tcb_desc->priority = skb->priority; 830 852 831 853 if (ether_type == ETH_P_PAE) {
+1 -1
drivers/staging/rtl8192e/rtllib_wx.c
··· 134 134 ((ht_cap->ShortGI40Mhz) ? 1 : 0) : 135 135 ((ht_cap->ShortGI20Mhz) ? 1 : 0); 136 136 137 - max_mcs = HTGetHighestMCSRate(ieee, ht_cap->MCS, 137 + max_mcs = ht_get_highest_mcs_rate(ieee, ht_cap->MCS, 138 138 MCS_FILTER_ALL); 139 139 rate = MCS_DATA_RATE[is40M][isShortGI][max_mcs & 0x7f]; 140 140 if (rate > max_rate)
+1 -2
drivers/staging/rtl8712/os_intfs.c
··· 221 221 222 222 static u32 start_drv_threads(struct _adapter *padapter) 223 223 { 224 - padapter->cmd_thread = kthread_run(r8712_cmd_thread, padapter, "%s", 225 - padapter->pnetdev->name); 224 + padapter->cmd_thread = kthread_run(r8712_cmd_thread, padapter, "%s", padapter->pnetdev->name); 226 225 if (IS_ERR(padapter->cmd_thread)) 227 226 return _FAIL; 228 227 return _SUCCESS;
+4 -5
drivers/staging/rtl8712/rtl8712_efuse.c
··· 213 213 u8 hworden = 0; 214 214 u8 efuse_data, word_cnts = 0; 215 215 216 - while (bContinual && efuse_one_byte_read(adapter, efuse_addr, 217 - &efuse_data) && (efuse_addr < efuse_available_max_size)) { 216 + while (bContinual && efuse_one_byte_read(adapter, efuse_addr, &efuse_data) && 217 + (efuse_addr < efuse_available_max_size)) { 218 218 if (efuse_data != 0xFF) { 219 219 hworden = efuse_data & 0x0F; 220 220 word_cnts = calculate_word_cnts(hworden); ··· 252 252 memset(tmpdata, 0xFF, PGPKT_DATA_SIZE); 253 253 for (tmpidx = 0; tmpidx < word_cnts * 2; 254 254 tmpidx++) { 255 - if (efuse_one_byte_read(adapter, 256 - efuse_addr + 1 + tmpidx, 257 - &efuse_data)) { 255 + if (efuse_one_byte_read(adapter, efuse_addr + 1 + tmpidx, 256 + &efuse_data)) { 258 257 tmpdata[tmpidx] = efuse_data; 259 258 } else { 260 259 ret = false;
+1 -2
drivers/staging/rtl8712/rtl8712_recv.c
··· 267 267 /*the first fragment*/ 268 268 if (!list_empty(&pdefrag_q->queue)) { 269 269 /*free current defrag_q */ 270 - r8712_free_recvframe_queue(pdefrag_q, 271 - pfree_recv_queue); 270 + r8712_free_recvframe_queue(pdefrag_q, pfree_recv_queue); 272 271 } 273 272 } 274 273 /* Then enqueue the 0~(n-1) fragment to the defrag_q */
+24 -36
drivers/staging/rtl8712/rtl8712_xmit.c
··· 147 147 } 148 148 149 149 static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, 150 - struct hw_xmit *phwxmit, 151 - struct tx_servq *ptxservq, 152 - struct __queue *pframe_queue) 150 + struct hw_xmit *phwxmit, struct tx_servq *ptxservq, 151 + struct __queue *pframe_queue) 153 152 { 154 153 struct list_head *xmitframe_plist, *xmitframe_phead; 155 154 struct xmit_frame *pxmitframe = NULL; ··· 166 167 } 167 168 168 169 static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv, 169 - struct hw_xmit *phwxmit_i, sint entry) 170 + struct hw_xmit *phwxmit_i, sint entry) 170 171 { 171 172 unsigned long irqL0; 172 173 struct list_head *sta_plist, *sta_phead; ··· 196 197 sta_phead = &phwxmit->sta_queue->queue; 197 198 sta_plist = sta_phead->next; 198 199 while (!end_of_queue_search(sta_phead, sta_plist)) { 199 - ptxservq = container_of(sta_plist, struct tx_servq, 200 - tx_pending); 200 + ptxservq = container_of(sta_plist, struct tx_servq, tx_pending); 201 201 pframe_queue = &ptxservq->sta_pending; 202 - pxmitframe = dequeue_one_xmitframe(pxmitpriv, phwxmit, 203 - ptxservq, pframe_queue); 202 + pxmitframe = dequeue_one_xmitframe(pxmitpriv, phwxmit, ptxservq, 203 + pframe_queue); 204 204 if (pxmitframe) { 205 205 phwxmit->accnt--; 206 206 goto exit_dequeue_xframe_ex; ··· 219 221 return pxmitframe; 220 222 } 221 223 222 - void r8712_do_queue_select(struct _adapter *padapter, 223 - struct pkt_attrib *pattrib) 224 + void r8712_do_queue_select(struct _adapter *padapter, struct pkt_attrib *pattrib) 224 225 { 225 226 unsigned int qsel = 0; 226 227 struct dvobj_priv *pdvobj = &padapter->dvobjpriv; ··· 289 292 r8712_xmit_complete(padapter, pxmitframe); 290 293 if (pxmitframe->attrib.ether_type != 0x0806) { 291 294 if ((pxmitframe->attrib.ether_type != 0x888e) && 292 - (pxmitframe->attrib.dhcp_pkt != 1)) { 293 - r8712_issue_addbareq_cmd(padapter, 294 - pxmitframe->attrib.priority); 295 + (pxmitframe->attrib.dhcp_pkt != 1)) { 296 + r8712_issue_addbareq_cmd(padapter, pxmitframe->attrib.priority); 295 297 } 296 298 } 297 299 pxmitframe->last[0] = 1; 298 - update_txdesc(pxmitframe, (uint *)(pxmitframe->buf_addr), 299 - pxmitframe->attrib.last_txcmdsz); 300 + update_txdesc(pxmitframe, (uint *)(pxmitframe->buf_addr), pxmitframe->attrib.last_txcmdsz); 300 301 /*padding zero */ 301 302 last_txcmdsz = pxmitframe->attrib.last_txcmdsz; 302 303 padding_sz = (8 - (last_txcmdsz % 8)); ··· 328 333 pxmitbuf->aggr_nr = 1; 329 334 } 330 335 331 - u16 r8712_xmitframe_aggr_next(struct xmit_buf *pxmitbuf, 332 - struct xmit_frame *pxmitframe) 336 + u16 r8712_xmitframe_aggr_next(struct xmit_buf *pxmitbuf, struct xmit_frame *pxmitframe) 333 337 { 334 338 pxmitframe->pxmitbuf = pxmitbuf; 335 339 pxmitbuf->priv_data = pxmitframe; ··· 368 374 pxmitframe->bpending[0] = false; 369 375 pxmitframe->mem_addr = pxmitbuf->pbuf; 370 376 371 - if ((pdvobj->ishighspeed && ((total_length + TXDESC_SIZE) % 0x200) == 372 - 0) || ((!pdvobj->ishighspeed && ((total_length + TXDESC_SIZE) % 373 - 0x40) == 0))) { 377 + if ((pdvobj->ishighspeed && ((total_length + TXDESC_SIZE) % 0x200) == 0) || 378 + ((!pdvobj->ishighspeed && ((total_length + TXDESC_SIZE) % 379 + 0x40) == 0))) { 374 380 ptxdesc->txdw0 |= cpu_to_le32 375 381 (((TXDESC_SIZE + OFFSET_SZ + 8) << OFFSET_SHT) & 376 382 0x00ff0000); ··· 381 387 0x00ff0000); 382 388 /*default = 32 bytes for TX Desc*/ 383 389 } 384 - r8712_write_port(pxmitframe->padapter, RTL8712_DMA_H2CCMD, 385 - total_length + TXDESC_SIZE, (u8 *)pxmitframe); 390 + r8712_write_port(pxmitframe->padapter, RTL8712_DMA_H2CCMD, total_length + TXDESC_SIZE, 391 + (u8 *)pxmitframe); 386 392 } 387 393 388 394 #endif ··· 612 618 pxmitframe = dequeue_xframe_ex(pxmitpriv, phwxmits, hwentry); 613 619 /* need to remember the 1st frame */ 614 620 if (pxmitframe) { 615 - 616 621 #ifdef CONFIG_R8712_TX_AGGR 617 622 /* 1. dequeue 2nd frame 618 623 * 2. aggr if 2nd xframe is dequeued, else dump directly 619 624 */ 620 625 if (AGGR_NR_HIGH_BOUND > 1) 621 - p2ndxmitframe = dequeue_xframe_ex(pxmitpriv, phwxmits, 622 - hwentry); 626 + p2ndxmitframe = dequeue_xframe_ex(pxmitpriv, phwxmits, hwentry); 623 627 if (pxmitframe->frame_tag != DATA_FRAMETAG) { 624 628 r8712_free_xmitbuf(pxmitpriv, pxmitbuf); 625 629 return false; ··· 631 639 if (p2ndxmitframe) { 632 640 u16 total_length; 633 641 634 - total_length = r8712_xmitframe_aggr_next( 635 - pxmitbuf, p2ndxmitframe); 642 + total_length = r8712_xmitframe_aggr_next(pxmitbuf, p2ndxmitframe); 636 643 do { 637 - p2ndxmitframe = dequeue_xframe_ex( 638 - pxmitpriv, phwxmits, hwentry); 644 + p2ndxmitframe = dequeue_xframe_ex(pxmitpriv, phwxmits, hwentry); 639 645 if (p2ndxmitframe) 640 646 total_length = 641 - r8712_xmitframe_aggr_next( 642 - pxmitbuf, 643 - p2ndxmitframe); 647 + r8712_xmitframe_aggr_next(pxmitbuf, p2ndxmitframe); 644 648 else 645 649 break; 646 650 } while (total_length <= 0x1800 && ··· 650 662 xmitframe_xmitbuf_attach(pxmitframe, pxmitbuf); 651 663 if (pxmitframe->frame_tag == DATA_FRAMETAG) { 652 664 if (pxmitframe->attrib.priority <= 15) 653 - res = r8712_xmitframe_coalesce(padapter, 654 - pxmitframe->pkt, pxmitframe); 665 + res = r8712_xmitframe_coalesce(padapter, pxmitframe->pkt, 666 + pxmitframe); 655 667 /* always return ndis_packet after 656 668 * r8712_xmitframe_coalesce 657 669 */ ··· 702 714 ff_hwaddr = get_ff_hwaddr(pxmitframe); 703 715 #ifdef CONFIG_R8712_TX_AGGR 704 716 r8712_write_port(padapter, RTL8712_DMA_H2CCMD, w_sz, 705 - (unsigned char *)pxmitframe); 717 + (unsigned char *)pxmitframe); 706 718 #else 707 719 r8712_write_port(padapter, ff_hwaddr, w_sz, 708 - (unsigned char *)pxmitframe); 720 + (unsigned char *)pxmitframe); 709 721 #endif 710 722 mem_addr += w_sz; 711 723 mem_addr = (u8 *)RND4(((addr_t)(mem_addr)));
+56 -103
drivers/staging/rtl8712/rtl871x_cmd.c
··· 242 242 kfree(ph2c); 243 243 return; 244 244 } 245 - init_h2fwcmd_w_parm_no_rsp(ph2c, psetchplanpara, 246 - GEN_CMD_CODE(_SetChannelPlan)); 245 + init_h2fwcmd_w_parm_no_rsp(ph2c, psetchplanpara, GEN_CMD_CODE(_SetChannelPlan)); 247 246 psetchplanpara->ChannelPlan = chplan; 248 247 r8712_enqueue_cmd(pcmdpriv, ph2c); 249 248 } ··· 301 302 padapter->mppriv.workparam.bcompleted = true; 302 303 } 303 304 304 - void r8712_readtssi_cmdrsp_callback(struct _adapter *padapter, 305 - struct cmd_obj *pcmd) 305 + void r8712_readtssi_cmdrsp_callback(struct _adapter *padapter, struct cmd_obj *pcmd) 306 306 { 307 307 kfree(pcmd->parmbuf); 308 308 kfree(pcmd); ··· 372 374 psecuritypriv->authenticator_ie[0] = (unsigned char) 373 375 psecnetwork->IELength; 374 376 if ((psecnetwork->IELength - 12) < (256 - 1)) 375 - memcpy(&psecuritypriv->authenticator_ie[1], 376 - &psecnetwork->IEs[12], psecnetwork->IELength - 12); 377 + memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], 378 + psecnetwork->IELength - 12); 377 379 else 378 - memcpy(&psecuritypriv->authenticator_ie[1], 379 - &psecnetwork->IEs[12], (256 - 1)); 380 + memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], (256 - 1)); 380 381 psecnetwork->IELength = 0; 381 382 /* 382 383 * If the driver wants to use the bssid to create the connection. ··· 385 388 if (!pmlmepriv->assoc_by_bssid) 386 389 ether_addr_copy(&pmlmepriv->assoc_bssid[0], 387 390 &pnetwork->network.MacAddress[0]); 388 - psecnetwork->IELength = r8712_restruct_sec_ie(padapter, 389 - &pnetwork->network.IEs[0], 390 - &psecnetwork->IEs[0], 391 - pnetwork->network.IELength); 391 + psecnetwork->IELength = r8712_restruct_sec_ie(padapter, &pnetwork->network.IEs[0], 392 + &psecnetwork->IEs[0], pnetwork->network.IELength); 392 393 pqospriv->qos_option = 0; 393 394 if (pregistrypriv->wmm_enable) { 394 395 u32 tmp_len; 395 396 396 - tmp_len = r8712_restruct_wmm_ie(padapter, 397 - &pnetwork->network.IEs[0], 398 - &psecnetwork->IEs[0], 399 - pnetwork->network.IELength, 400 - psecnetwork->IELength); 397 + tmp_len = r8712_restruct_wmm_ie(padapter, &pnetwork->network.IEs[0], 398 + &psecnetwork->IEs[0], pnetwork->network.IELength, 399 + psecnetwork->IELength); 401 400 if (psecnetwork->IELength != tmp_len) { 402 401 psecnetwork->IELength = tmp_len; 403 402 pqospriv->qos_option = 1; /* WMM IE in beacon */ ··· 420 427 psecuritypriv->supplicant_ie[0] = (u8)psecnetwork->IELength; 421 428 if (psecnetwork->IELength < 255) 422 429 memcpy(&psecuritypriv->supplicant_ie[1], &psecnetwork->IEs[0], 423 - psecnetwork->IELength); 430 + psecnetwork->IELength); 424 431 else 425 432 memcpy(&psecuritypriv->supplicant_ie[1], &psecnetwork->IEs[0], 426 - 255); 433 + 255); 427 434 /* get cmdsz before endian conversion */ 428 435 pcmd->cmdsz = r8712_get_wlan_bssid_ex_sz(psecnetwork); 429 436 #ifdef __BIG_ENDIAN 430 437 /* wlan_network endian conversion */ 431 438 psecnetwork->Length = cpu_to_le32(psecnetwork->Length); 432 - psecnetwork->Ssid.SsidLength = cpu_to_le32( 433 - psecnetwork->Ssid.SsidLength); 439 + psecnetwork->Ssid.SsidLength = cpu_to_le32(psecnetwork->Ssid.SsidLength); 434 440 psecnetwork->Privacy = cpu_to_le32(psecnetwork->Privacy); 435 441 psecnetwork->Rssi = cpu_to_le32(psecnetwork->Rssi); 436 - psecnetwork->NetworkTypeInUse = cpu_to_le32( 437 - psecnetwork->NetworkTypeInUse); 438 - psecnetwork->Configuration.ATIMWindow = cpu_to_le32( 439 - psecnetwork->Configuration.ATIMWindow); 440 - psecnetwork->Configuration.BeaconPeriod = cpu_to_le32( 441 - psecnetwork->Configuration.BeaconPeriod); 442 - psecnetwork->Configuration.DSConfig = cpu_to_le32( 443 - psecnetwork->Configuration.DSConfig); 444 - psecnetwork->Configuration.FHConfig.DwellTime = cpu_to_le32( 445 - psecnetwork->Configuration.FHConfig.DwellTime); 446 - psecnetwork->Configuration.FHConfig.HopPattern = cpu_to_le32( 447 - psecnetwork->Configuration.FHConfig.HopPattern); 448 - psecnetwork->Configuration.FHConfig.HopSet = cpu_to_le32( 449 - psecnetwork->Configuration.FHConfig.HopSet); 450 - psecnetwork->Configuration.FHConfig.Length = cpu_to_le32( 451 - psecnetwork->Configuration.FHConfig.Length); 452 - psecnetwork->Configuration.Length = cpu_to_le32( 453 - psecnetwork->Configuration.Length); 454 - psecnetwork->InfrastructureMode = cpu_to_le32( 455 - psecnetwork->InfrastructureMode); 442 + psecnetwork->NetworkTypeInUse = cpu_to_le32(psecnetwork->NetworkTypeInUse); 443 + psecnetwork->Configuration.ATIMWindow = cpu_to_le32(psecnetwork->Configuration.ATIMWindow); 444 + psecnetwork->Configuration.BeaconPeriod = cpu_to_le32(psecnetwork->Configuration.BeaconPeriod); 445 + psecnetwork->Configuration.DSConfig = cpu_to_le32(psecnetwork->Configuration.DSConfig); 446 + psecnetwork->Configuration.FHConfig.DwellTime = cpu_to_le32(psecnetwork->Configuration.FHConfig.DwellTime); 447 + psecnetwork->Configuration.FHConfig.HopPattern = cpu_to_le32(psecnetwork->Configuration.FHConfig.HopPattern); 448 + psecnetwork->Configuration.FHConfig.HopSet = cpu_to_le32(psecnetwork->Configuration.FHConfig.HopSet); 449 + psecnetwork->Configuration.FHConfig.Length = cpu_to_le32(psecnetwork->Configuration.FHConfig.Length); 450 + psecnetwork->Configuration.Length = cpu_to_le32(psecnetwork->Configuration.Length); 451 + psecnetwork->InfrastructureMode = cpu_to_le32(psecnetwork->InfrastructureMode); 456 452 psecnetwork->IELength = cpu_to_le32(psecnetwork->IELength); 457 453 #endif 458 454 INIT_LIST_HEAD(&pcmd->list); ··· 467 485 kfree(pdisconnect_cmd); 468 486 return; 469 487 } 470 - init_h2fwcmd_w_parm_no_rsp(pdisconnect_cmd, pdisconnect, 471 - _DisConnect_CMD_); 488 + init_h2fwcmd_w_parm_no_rsp(pdisconnect_cmd, pdisconnect, _DisConnect_CMD_); 472 489 r8712_enqueue_cmd(pcmdpriv, pdisconnect_cmd); 473 490 } 474 491 475 492 void r8712_setopmode_cmd(struct _adapter *padapter, 476 - enum NDIS_802_11_NETWORK_INFRASTRUCTURE networktype) 493 + enum NDIS_802_11_NETWORK_INFRASTRUCTURE networktype) 477 494 { 478 495 struct cmd_obj *ph2c; 479 496 struct setopmode_parm *psetop; ··· 524 543 psetstakey_para->algorithm = (unsigned char) 525 544 psecuritypriv->PrivacyAlgrthm; 526 545 else 527 - GET_ENCRY_ALGO(psecuritypriv, sta, 528 - psetstakey_para->algorithm, false); 546 + GET_ENCRY_ALGO(psecuritypriv, sta, psetstakey_para->algorithm, false); 529 547 if (unicast_key) 530 548 memcpy(&psetstakey_para->key, &sta->x_UncstKey, 16); 531 549 else 532 - memcpy(&psetstakey_para->key, 533 - &psecuritypriv->XGrpKey[ 534 - psecuritypriv->XGrpKeyid - 1]. skey, 16); 550 + memcpy(&psetstakey_para->key, &psecuritypriv->XGrpKey[psecuritypriv->XGrpKeyid - 1]. 551 + skey, 16); 535 552 r8712_enqueue_cmd(pcmdpriv, ph2c); 536 553 } 537 554 ··· 547 568 kfree(ph2c); 548 569 return; 549 570 } 550 - init_h2fwcmd_w_parm_no_rsp(ph2c, psetMacAddr_para, 551 - _SetMacAddress_CMD_); 571 + init_h2fwcmd_w_parm_no_rsp(ph2c, psetMacAddr_para, _SetMacAddress_CMD_); 552 572 ether_addr_copy(psetMacAddr_para->MacAddr, mac_addr); 553 573 r8712_enqueue_cmd(pcmdpriv, ph2c); 554 574 } ··· 567 589 return; 568 590 } 569 591 paddbareq_parm->tid = tid; 570 - init_h2fwcmd_w_parm_no_rsp(ph2c, paddbareq_parm, 571 - GEN_CMD_CODE(_AddBAReq)); 592 + init_h2fwcmd_w_parm_no_rsp(ph2c, paddbareq_parm, GEN_CMD_CODE(_AddBAReq)); 572 593 r8712_enqueue_cmd_ex(pcmdpriv, ph2c); 573 594 } 574 595 ··· 621 644 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 622 645 623 646 if (pcmd->res != H2C_SUCCESS) 624 - mod_timer(&pmlmepriv->assoc_timer, 625 - jiffies + msecs_to_jiffies(1)); 647 + mod_timer(&pmlmepriv->assoc_timer, jiffies + msecs_to_jiffies(1)); 626 648 r8712_free_cmd_obj(pcmd); 627 649 } 628 650 629 - void r8712_createbss_cmd_callback(struct _adapter *padapter, 630 - struct cmd_obj *pcmd) 651 + void r8712_createbss_cmd_callback(struct _adapter *padapter, struct cmd_obj *pcmd) 631 652 { 632 653 unsigned long irqL; 633 654 struct sta_info *psta = NULL; ··· 635 660 struct wlan_network *tgt_network = &(pmlmepriv->cur_network); 636 661 637 662 if (pcmd->res != H2C_SUCCESS) 638 - mod_timer(&pmlmepriv->assoc_timer, 639 - jiffies + msecs_to_jiffies(1)); 663 + mod_timer(&pmlmepriv->assoc_timer, jiffies + msecs_to_jiffies(1)); 640 664 del_timer(&pmlmepriv->assoc_timer); 641 665 #ifdef __BIG_ENDIAN 642 666 /* endian_convert */ ··· 644 670 pnetwork->Privacy = le32_to_cpu(pnetwork->Privacy); 645 671 pnetwork->Rssi = le32_to_cpu(pnetwork->Rssi); 646 672 pnetwork->NetworkTypeInUse = le32_to_cpu(pnetwork->NetworkTypeInUse); 647 - pnetwork->Configuration.ATIMWindow = 648 - le32_to_cpu(pnetwork->Configuration.ATIMWindow); 649 - pnetwork->Configuration.DSConfig = 650 - le32_to_cpu(pnetwork->Configuration.DSConfig); 651 - pnetwork->Configuration.FHConfig.DwellTime = 652 - le32_to_cpu(pnetwork->Configuration.FHConfig.DwellTime); 653 - pnetwork->Configuration.FHConfig.HopPattern = 654 - le32_to_cpu(pnetwork->Configuration.FHConfig.HopPattern); 655 - pnetwork->Configuration.FHConfig.HopSet = 656 - le32_to_cpu(pnetwork->Configuration.FHConfig.HopSet); 657 - pnetwork->Configuration.FHConfig.Length = 658 - le32_to_cpu(pnetwork->Configuration.FHConfig.Length); 659 - pnetwork->Configuration.Length = 660 - le32_to_cpu(pnetwork->Configuration.Length); 661 - pnetwork->InfrastructureMode = 662 - le32_to_cpu(pnetwork->InfrastructureMode); 673 + pnetwork->Configuration.ATIMWindow = le32_to_cpu(pnetwork->Configuration.ATIMWindow); 674 + pnetwork->Configuration.DSConfig = le32_to_cpu(pnetwork->Configuration.DSConfig); 675 + pnetwork->Configuration.FHConfig.DwellTime = le32_to_cpu(pnetwork->Configuration.FHConfig.DwellTime); 676 + pnetwork->Configuration.FHConfig.HopPattern = le32_to_cpu(pnetwork->Configuration.FHConfig.HopPattern); 677 + pnetwork->Configuration.FHConfig.HopSet = le32_to_cpu(pnetwork->Configuration.FHConfig.HopSet); 678 + pnetwork->Configuration.FHConfig.Length = le32_to_cpu(pnetwork->Configuration.FHConfig.Length); 679 + pnetwork->Configuration.Length = le32_to_cpu(pnetwork->Configuration.Length); 680 + pnetwork->InfrastructureMode = le32_to_cpu(pnetwork->InfrastructureMode); 663 681 pnetwork->IELength = le32_to_cpu(pnetwork->IELength); 664 682 #endif 665 683 spin_lock_irqsave(&pmlmepriv->lock, irqL); 666 684 if ((pmlmepriv->fw_state) & WIFI_AP_STATE) { 667 - psta = r8712_get_stainfo(&padapter->stapriv, 668 - pnetwork->MacAddress); 685 + psta = r8712_get_stainfo(&padapter->stapriv, pnetwork->MacAddress); 669 686 if (!psta) { 670 - psta = r8712_alloc_stainfo(&padapter->stapriv, 671 - pnetwork->MacAddress); 687 + psta = r8712_alloc_stainfo(&padapter->stapriv, pnetwork->MacAddress); 672 688 if (!psta) 673 689 goto createbss_cmd_fail; 674 690 } ··· 666 702 } else { 667 703 pwlan = _r8712_alloc_network(pmlmepriv); 668 704 if (!pwlan) { 669 - pwlan = r8712_get_oldest_wlan_network( 670 - &pmlmepriv->scanned_queue); 705 + pwlan = r8712_get_oldest_wlan_network(&pmlmepriv->scanned_queue); 671 706 if (!pwlan) 672 707 goto createbss_cmd_fail; 673 708 pwlan->last_scanned = jiffies; 674 709 } else { 675 - list_add_tail(&(pwlan->list), 676 - &pmlmepriv->scanned_queue.queue); 710 + list_add_tail(&(pwlan->list), &pmlmepriv->scanned_queue.queue); 677 711 } 678 712 pnetwork->Length = r8712_get_wlan_bssid_ex_sz(pnetwork); 679 713 memcpy(&(pwlan->network), pnetwork, pnetwork->Length); 680 714 pwlan->fixed = true; 681 - memcpy(&tgt_network->network, pnetwork, 682 - (r8712_get_wlan_bssid_ex_sz(pnetwork))); 715 + memcpy(&tgt_network->network, pnetwork, (r8712_get_wlan_bssid_ex_sz(pnetwork))); 683 716 if (pmlmepriv->fw_state & _FW_UNDER_LINKING) 684 717 pmlmepriv->fw_state ^= _FW_UNDER_LINKING; 685 718 /* ··· 689 728 r8712_free_cmd_obj(pcmd); 690 729 } 691 730 692 - void r8712_setstaKey_cmdrsp_callback(struct _adapter *padapter, 693 - struct cmd_obj *pcmd) 731 + void r8712_setstaKey_cmdrsp_callback(struct _adapter *padapter, struct cmd_obj *pcmd) 694 732 { 695 733 struct sta_priv *pstapriv = &padapter->stapriv; 696 - struct set_stakey_rsp *psetstakey_rsp = (struct set_stakey_rsp *) 697 - (pcmd->rsp); 698 - struct sta_info *psta = r8712_get_stainfo(pstapriv, 699 - psetstakey_rsp->addr); 734 + struct set_stakey_rsp *psetstakey_rsp = (struct set_stakey_rsp *) (pcmd->rsp); 735 + struct sta_info *psta = r8712_get_stainfo(pstapriv, psetstakey_rsp->addr); 700 736 701 737 if (!psta) 702 738 goto exit; ··· 708 750 unsigned long irqL; 709 751 struct sta_priv *pstapriv = &padapter->stapriv; 710 752 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 711 - struct set_assocsta_parm *passocsta_parm = 712 - (struct set_assocsta_parm *)(pcmd->parmbuf); 713 - struct set_assocsta_rsp *passocsta_rsp = 714 - (struct set_assocsta_rsp *) (pcmd->rsp); 715 - struct sta_info *psta = r8712_get_stainfo(pstapriv, 716 - passocsta_parm->addr); 753 + struct set_assocsta_parm *passocsta_parm = (struct set_assocsta_parm *)(pcmd->parmbuf); 754 + struct set_assocsta_rsp *passocsta_rsp = (struct set_assocsta_rsp *) (pcmd->rsp); 755 + struct sta_info *psta = r8712_get_stainfo(pstapriv, passocsta_parm->addr); 717 756 718 757 if (!psta) 719 758 return; 720 759 psta->aid = psta->mac_id = passocsta_rsp->cam_id; 721 760 spin_lock_irqsave(&pmlmepriv->lock, irqL); 722 - if ((check_fwstate(pmlmepriv, WIFI_MP_STATE)) && 723 - (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))) 761 + if ((check_fwstate(pmlmepriv, WIFI_MP_STATE)) && (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))) 724 762 pmlmepriv->fw_state ^= _FW_UNDER_LINKING; 725 763 set_fwstate(pmlmepriv, _FW_LINKED); 726 764 spin_unlock_irqrestore(&pmlmepriv->lock, irqL); 727 765 r8712_free_cmd_obj(pcmd); 728 766 } 729 767 730 - void r8712_disconnectCtrlEx_cmd(struct _adapter *adapter, u32 enableDrvCtrl, 731 - u32 tryPktCnt, u32 tryPktInterval, u32 firstStageTO) 768 + void r8712_disconnectCtrlEx_cmd(struct _adapter *adapter, u32 enableDrvCtrl, u32 tryPktCnt, 769 + u32 tryPktInterval, u32 firstStageTO) 732 770 { 733 771 struct cmd_obj *ph2c; 734 772 struct DisconnectCtrlEx_param *param; ··· 744 790 param->TryPktInterval = (unsigned char)tryPktInterval; 745 791 param->FirstStageTO = (unsigned int)firstStageTO; 746 792 747 - init_h2fwcmd_w_parm_no_rsp(ph2c, param, 748 - GEN_CMD_CODE(_DisconnectCtrlEx)); 793 + init_h2fwcmd_w_parm_no_rsp(ph2c, param, GEN_CMD_CODE(_DisconnectCtrlEx)); 749 794 r8712_enqueue_cmd(pcmdpriv, ph2c); 750 795 }
+13 -24
drivers/staging/rtl8712/rtl871x_cmd.h
··· 716 716 #define H2C_RESERVED 0x07 717 717 718 718 void r8712_setMacAddr_cmd(struct _adapter *padapter, const u8 *mac_addr); 719 - u8 r8712_sitesurvey_cmd(struct _adapter *padapter, 720 - struct ndis_802_11_ssid *pssid); 719 + u8 r8712_sitesurvey_cmd(struct _adapter *padapter, struct ndis_802_11_ssid *pssid); 721 720 int r8712_createbss_cmd(struct _adapter *padapter); 722 721 void r8712_setstakey_cmd(struct _adapter *padapter, u8 *psta, u8 unicast_key); 723 - int r8712_joinbss_cmd(struct _adapter *padapter, 724 - struct wlan_network *pnetwork); 722 + int r8712_joinbss_cmd(struct _adapter *padapter, struct wlan_network *pnetwork); 725 723 void r8712_disassoc_cmd(struct _adapter *padapter); 726 - void r8712_setopmode_cmd(struct _adapter *padapter, 727 - enum NDIS_802_11_NETWORK_INFRASTRUCTURE networktype); 724 + void r8712_setopmode_cmd(struct _adapter *padapter, enum NDIS_802_11_NETWORK_INFRASTRUCTURE networktype); 728 725 int r8712_setdatarate_cmd(struct _adapter *padapter, u8 *rateset); 729 726 void r8712_set_chplan_cmd(struct _adapter *padapter, int chplan); 730 727 int r8712_getrfreg_cmd(struct _adapter *padapter, u8 offset, u8 *pval); 731 728 int r8712_setrfreg_cmd(struct _adapter *padapter, u8 offset, u32 val); 732 729 void r8712_addbareq_cmd(struct _adapter *padapter, u8 tid); 733 730 void r8712_wdg_wk_cmd(struct _adapter *padapter); 734 - void r8712_survey_cmd_callback(struct _adapter *padapter, 735 - struct cmd_obj *pcmd); 736 - void r8712_disassoc_cmd_callback(struct _adapter *padapter, 737 - struct cmd_obj *pcmd); 738 - void r8712_joinbss_cmd_callback(struct _adapter *padapter, 739 - struct cmd_obj *pcmd); 740 - void r8712_createbss_cmd_callback(struct _adapter *padapter, 741 - struct cmd_obj *pcmd); 742 - void r8712_getbbrfreg_cmdrsp_callback(struct _adapter *padapter, 743 - struct cmd_obj *pcmd); 744 - void r8712_readtssi_cmdrsp_callback(struct _adapter *padapter, 745 - struct cmd_obj *pcmd); 746 - void r8712_setstaKey_cmdrsp_callback(struct _adapter *padapter, 747 - struct cmd_obj *pcmd); 748 - void r8712_setassocsta_cmdrsp_callback(struct _adapter *padapter, 749 - struct cmd_obj *pcmd); 750 - void r8712_disconnectCtrlEx_cmd(struct _adapter *adapter, u32 enableDrvCtrl, 751 - u32 tryPktCnt, u32 tryPktInterval, u32 firstStageTO); 731 + void r8712_survey_cmd_callback(struct _adapter *padapter, struct cmd_obj *pcmd); 732 + void r8712_disassoc_cmd_callback(struct _adapter *padapter, struct cmd_obj *pcmd); 733 + void r8712_joinbss_cmd_callback(struct _adapter *padapter, struct cmd_obj *pcmd); 734 + void r8712_createbss_cmd_callback(struct _adapter *padapter, struct cmd_obj *pcmd); 735 + void r8712_getbbrfreg_cmdrsp_callback(struct _adapter *padapter, struct cmd_obj *pcmd); 736 + void r8712_readtssi_cmdrsp_callback(struct _adapter *padapter, struct cmd_obj *pcmd); 737 + void r8712_setstaKey_cmdrsp_callback(struct _adapter *padapter, struct cmd_obj *pcmd); 738 + void r8712_setassocsta_cmdrsp_callback(struct _adapter *padapter, struct cmd_obj *pcmd); 739 + void r8712_disconnectCtrlEx_cmd(struct _adapter *adapter, u32 enableDrvCtrl, u32 tryPktCnt, 740 + u32 tryPktInterval, u32 firstStageTO); 752 741 753 742 struct _cmd_callback { 754 743 u32 cmd_code;
+74 -129
drivers/staging/rtl8712/rtl871x_ioctl_linux.c
··· 59 59 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 60 60 61 61 wrqu.ap_addr.sa_family = ARPHRD_ETHER; 62 - memcpy(wrqu.ap_addr.sa_data, pmlmepriv->cur_network.network.MacAddress, 63 - ETH_ALEN); 62 + memcpy(wrqu.ap_addr.sa_data, pmlmepriv->cur_network.network.MacAddress, ETH_ALEN); 64 63 wireless_send_event(padapter->pnetdev, SIOCGIWAP, &wrqu, NULL); 65 64 } 66 65 ··· 110 111 memcpy(grk[param->u.crypt.idx - 1].skey, 111 112 &param->u.crypt.key[24], 8); 112 113 padapter->securitypriv.binstallGrpkey = true; 113 - r8712_set_key(padapter, &padapter->securitypriv, 114 - param->u.crypt.idx); 114 + r8712_set_key(padapter, &padapter->securitypriv, param->u.crypt.idx); 115 115 if (padapter->registrypriv.power_mgnt > PS_MODE_ACTIVE) { 116 - if (padapter->registrypriv.power_mgnt != 117 - padapter->pwrctrlpriv.pwr_mode) 116 + if (padapter->registrypriv.power_mgnt != padapter->pwrctrlpriv.pwr_mode) 118 117 mod_timer(&padapter->mlmepriv.dhcp_timer, 119 118 jiffies + msecs_to_jiffies(60000)); 120 119 } ··· 145 148 memset(iwe, 0, sizeof(*iwe)); 146 149 iwe->cmd = IWEVCUSTOM; 147 150 iwe->u.data.length = (u16)strlen(buf); 148 - start = iwe_stream_add_point(info, start, stop, 149 - iwe, buf); 151 + start = iwe_stream_add_point(info, start, stop, iwe, buf); 150 152 memset(iwe, 0, sizeof(*iwe)); 151 153 iwe->cmd = IWEVGENIE; 152 154 iwe->u.data.length = (u16)wpa_len; 153 - start = iwe_stream_add_point(info, start, stop, 154 - iwe, wpa_ie); 155 + start = iwe_stream_add_point(info, start, stop, iwe, wpa_ie); 155 156 } 156 157 if (rsn_len > 0) { 157 158 memset(buf, 0, MAX_WPA_IE_LEN); ··· 163 168 memset(iwe, 0, sizeof(*iwe)); 164 169 iwe->cmd = IWEVCUSTOM; 165 170 iwe->u.data.length = strlen(buf); 166 - start = iwe_stream_add_point(info, start, stop, 167 - iwe, buf); 171 + start = iwe_stream_add_point(info, start, stop, iwe, buf); 168 172 memset(iwe, 0, sizeof(*iwe)); 169 173 iwe->cmd = IWEVGENIE; 170 174 iwe->u.data.length = rsn_len; 171 - start = iwe_stream_add_point(info, start, stop, iwe, 172 - rsn_ie); 175 + start = iwe_stream_add_point(info, start, stop, iwe, rsn_ie); 173 176 } 174 177 175 178 return start; ··· 182 189 u8 wps_ie[512]; 183 190 uint wps_ielen; 184 191 185 - if (r8712_get_wps_ie(pnetwork->network.IEs, 186 - pnetwork->network.IELength, 187 - wps_ie, &wps_ielen)) { 192 + if (r8712_get_wps_ie(pnetwork->network.IEs, pnetwork->network.IELength, wps_ie, &wps_ielen)) { 188 193 if (wps_ielen > 2) { 189 194 iwe->cmd = IWEVGENIE; 190 195 iwe->u.data.length = (u16)wps_ielen; 191 - start = iwe_stream_add_point(info, start, stop, 192 - iwe, wps_ie); 196 + start = iwe_stream_add_point(info, start, stop, iwe, wps_ie); 193 197 } 194 198 } 195 199 ··· 249 259 start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_CHAR_LEN); 250 260 /* Add mode */ 251 261 iwe.cmd = SIOCGIWMODE; 252 - memcpy((u8 *)&cap, r8712_get_capability_from_ie(pnetwork->network.IEs), 253 - 2); 262 + memcpy((u8 *)&cap, r8712_get_capability_from_ie(pnetwork->network.IEs), 2); 254 263 le16_to_cpus(&cap); 255 264 if (cap & (WLAN_CAPABILITY_IBSS | WLAN_CAPABILITY_ESS)) { 256 265 if (cap & WLAN_CAPABILITY_ESS) 257 266 iwe.u.mode = (u32)IW_MODE_MASTER; 258 267 else 259 268 iwe.u.mode = (u32)IW_MODE_ADHOC; 260 - start = iwe_stream_add_event(info, start, stop, &iwe, 261 - IW_EV_UINT_LEN); 269 + start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_UINT_LEN); 262 270 } 263 271 /* Add frequency/channel */ 264 272 iwe.cmd = SIOCGIWFREQ; ··· 264 276 /* check legal index */ 265 277 u8 dsconfig = pnetwork->network.Configuration.DSConfig; 266 278 267 - if (dsconfig >= 1 && dsconfig <= sizeof( 268 - ieee80211_wlan_frequencies) / sizeof(long)) 269 - iwe.u.freq.m = 270 - (s32)(ieee80211_wlan_frequencies 271 - [dsconfig - 1] * 100000); 279 + if (dsconfig >= 1 && dsconfig <= sizeof(ieee80211_wlan_frequencies) / sizeof(long)) 280 + iwe.u.freq.m = (s32)(ieee80211_wlan_frequencies[dsconfig - 1] * 100000); 272 281 else 273 282 iwe.u.freq.m = 0; 274 283 } 275 284 iwe.u.freq.e = (s16)1; 276 285 iwe.u.freq.i = (u8)pnetwork->network.Configuration.DSConfig; 277 286 start = iwe_stream_add_event(info, start, stop, &iwe, 278 - IW_EV_FREQ_LEN); 287 + IW_EV_FREQ_LEN); 279 288 /* Add encryption capability */ 280 289 iwe.cmd = SIOCGIWENCODE; 281 290 if (cap & WLAN_CAPABILITY_PRIVACY) 282 - iwe.u.data.flags = (u16)(IW_ENCODE_ENABLED | 283 - IW_ENCODE_NOKEY); 291 + iwe.u.data.flags = (u16)(IW_ENCODE_ENABLED | IW_ENCODE_NOKEY); 284 292 else 285 293 iwe.u.data.flags = (u16)(IW_ENCODE_DISABLED); 286 294 iwe.u.data.length = (u16)0; 287 - start = iwe_stream_add_point(info, start, stop, &iwe, 288 - pnetwork->network.Ssid.Ssid); 295 + start = iwe_stream_add_point(info, start, stop, &iwe, pnetwork->network.Ssid.Ssid); 289 296 /*Add basic and extended rates */ 290 297 current_val = start + iwe_stream_lcp_len(info); 291 298 iwe.cmd = SIOCGIWRATE; ··· 290 307 i = 0; 291 308 while (pnetwork->network.rates[i] != 0) { 292 309 /* Bit rate given in 500 kb/s units */ 293 - iwe.u.bitrate.value = (pnetwork->network.rates[i++] & 294 - 0x7F) * 500000; 295 - current_val = iwe_stream_add_value(info, start, current_val, 296 - stop, &iwe, IW_EV_PARAM_LEN); 310 + iwe.u.bitrate.value = (pnetwork->network.rates[i++] & 0x7F) * 500000; 311 + current_val = iwe_stream_add_value(info, start, current_val, stop, &iwe, 312 + IW_EV_PARAM_LEN); 297 313 } 298 314 /* Check if we added any event */ 299 315 if ((current_val - start) > iwe_stream_lcp_len(info)) ··· 306 324 iwe.cmd = IWEVQUAL; 307 325 rssi = r8712_signal_scale_mapping(pnetwork->network.Rssi); 308 326 /* we only update signal_level (signal strength) that is rssi. */ 309 - iwe.u.qual.updated = (u8)(IW_QUAL_QUAL_INVALID | IW_QUAL_LEVEL_UPDATED | 310 - IW_QUAL_NOISE_INVALID); 327 + iwe.u.qual.updated = (u8)(IW_QUAL_QUAL_INVALID | IW_QUAL_LEVEL_UPDATED | IW_QUAL_NOISE_INVALID); 311 328 iwe.u.qual.level = rssi; /* signal strength */ 312 329 iwe.u.qual.qual = 0; /* signal quality */ 313 330 iwe.u.qual.noise = 0; /* noise level */ ··· 471 490 goto exit; 472 491 } 473 492 if (r8712_parse_wpa_ie(buf, ielen, &group_cipher, 474 - &pairwise_cipher) == 0) { 493 + &pairwise_cipher) == 0) { 475 494 padapter->securitypriv.AuthAlgrthm = 2; 476 495 padapter->securitypriv.ndisauthtype = 477 496 Ndis802_11AuthModeWPAPSK; 478 497 } 479 498 if (r8712_parse_wpa2_ie(buf, ielen, &group_cipher, 480 - &pairwise_cipher) == 0) { 499 + &pairwise_cipher) == 0) { 481 500 padapter->securitypriv.AuthAlgrthm = 2; 482 501 padapter->securitypriv.ndisauthtype = 483 502 Ndis802_11AuthModeWPA2PSK; 484 503 } 485 504 switch (group_cipher) { 486 505 case WPA_CIPHER_NONE: 487 - padapter->securitypriv.XGrpPrivacy = 488 - _NO_PRIVACY_; 489 - padapter->securitypriv.ndisencryptstatus = 490 - Ndis802_11EncryptionDisabled; 506 + padapter->securitypriv.XGrpPrivacy = _NO_PRIVACY_; 507 + padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled; 491 508 break; 492 509 case WPA_CIPHER_WEP40: 493 510 padapter->securitypriv.XGrpPrivacy = _WEP40_; 494 - padapter->securitypriv.ndisencryptstatus = 495 - Ndis802_11Encryption1Enabled; 511 + padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled; 496 512 break; 497 513 case WPA_CIPHER_TKIP: 498 514 padapter->securitypriv.XGrpPrivacy = _TKIP_; 499 - padapter->securitypriv.ndisencryptstatus = 500 - Ndis802_11Encryption2Enabled; 515 + padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption2Enabled; 501 516 break; 502 517 case WPA_CIPHER_CCMP: 503 518 padapter->securitypriv.XGrpPrivacy = _AES_; 504 - padapter->securitypriv.ndisencryptstatus = 505 - Ndis802_11Encryption3Enabled; 519 + padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption3Enabled; 506 520 break; 507 521 case WPA_CIPHER_WEP104: 508 522 padapter->securitypriv.XGrpPrivacy = _WEP104_; 509 - padapter->securitypriv.ndisencryptstatus = 510 - Ndis802_11Encryption1Enabled; 523 + padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled; 511 524 break; 512 525 } 513 526 switch (pairwise_cipher) { 514 527 case WPA_CIPHER_NONE: 515 - padapter->securitypriv.PrivacyAlgrthm = 516 - _NO_PRIVACY_; 517 - padapter->securitypriv.ndisencryptstatus = 518 - Ndis802_11EncryptionDisabled; 528 + padapter->securitypriv.PrivacyAlgrthm = _NO_PRIVACY_; 529 + padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled; 519 530 break; 520 531 case WPA_CIPHER_WEP40: 521 532 padapter->securitypriv.PrivacyAlgrthm = _WEP40_; 522 - padapter->securitypriv.ndisencryptstatus = 523 - Ndis802_11Encryption1Enabled; 533 + padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled; 524 534 break; 525 535 case WPA_CIPHER_TKIP: 526 536 padapter->securitypriv.PrivacyAlgrthm = _TKIP_; 527 - padapter->securitypriv.ndisencryptstatus = 528 - Ndis802_11Encryption2Enabled; 537 + padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption2Enabled; 529 538 break; 530 539 case WPA_CIPHER_CCMP: 531 540 padapter->securitypriv.PrivacyAlgrthm = _AES_; 532 - padapter->securitypriv.ndisencryptstatus = 533 - Ndis802_11Encryption3Enabled; 541 + padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption3Enabled; 534 542 break; 535 543 case WPA_CIPHER_WEP104: 536 544 padapter->securitypriv.PrivacyAlgrthm = _WEP104_; 537 - padapter->securitypriv.ndisencryptstatus = 538 - Ndis802_11Encryption1Enabled; 545 + padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled; 539 546 break; 540 547 } 541 548 padapter->securitypriv.wps_phase = false; ··· 543 574 (buf[cnt + 1] + 2) : 544 575 (MAX_WPA_IE_LEN << 2); 545 576 memcpy(padapter->securitypriv.wps_ie, 546 - &buf[cnt], 547 - padapter->securitypriv.wps_ie_len); 577 + &buf[cnt], 578 + padapter->securitypriv.wps_ie_len); 548 579 padapter->securitypriv.wps_phase = 549 580 true; 550 581 netdev_info(padapter->pnetdev, "r8712u: SET WPS_IE, wps_phase==true\n"); ··· 561 592 return ret; 562 593 } 563 594 564 - static int r8711_wx_get_name(struct net_device *dev, 565 - struct iw_request_info *info, 595 + static int r8711_wx_get_name(struct net_device *dev, struct iw_request_info *info, 566 596 union iwreq_data *wrqu, char *extra) 567 597 { 568 598 struct _adapter *padapter = netdev_priv(dev); ··· 572 604 struct wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network; 573 605 u8 *prates; 574 606 575 - if (check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE) == 576 - true) { 607 + if (check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE) == true) { 577 608 /* parsing HT_CAP_IE */ 578 609 p = r8712_get_ie(&pcur_bss->IEs[12], WLAN_EID_HT_CAPABILITY, 579 610 &ht_ielen, pcur_bss->IELength - 12); ··· 625 658 int rc = 0; 626 659 627 660 /* If setting by frequency, convert to a channel */ 628 - if ((fwrq->e == 1) && 629 - (fwrq->m >= 241200000) && 630 - (fwrq->m <= 248700000)) { 661 + if ((fwrq->e == 1) && (fwrq->m >= 241200000) && (fwrq->m <= 248700000)) { 631 662 int f = fwrq->m / 100000; 632 663 int c = 0; 633 664 ··· 650 685 return rc; 651 686 } 652 687 653 - static int r8711_wx_get_freq(struct net_device *dev, 654 - struct iw_request_info *info, 688 + static int r8711_wx_get_freq(struct net_device *dev, struct iw_request_info *info, 655 689 union iwreq_data *wrqu, char *extra) 656 690 { 657 691 struct _adapter *padapter = netdev_priv(dev); ··· 709 745 if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) 710 746 wrqu->mode = IW_MODE_INFRA; 711 747 else if (check_fwstate(pmlmepriv, 712 - WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE)) 748 + WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE)) 713 749 wrqu->mode = IW_MODE_ADHOC; 714 750 else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) 715 751 wrqu->mode = IW_MODE_MASTER; ··· 718 754 return 0; 719 755 } 720 756 721 - static int r871x_wx_set_pmkid(struct net_device *dev, 722 - struct iw_request_info *a, 723 - union iwreq_data *wrqu, char *extra) 757 + static int r871x_wx_set_pmkid(struct net_device *dev, struct iw_request_info *a, 758 + union iwreq_data *wrqu, char *extra) 724 759 { 725 760 struct _adapter *padapter = netdev_priv(dev); 726 761 struct security_priv *psecuritypriv = &padapter->securitypriv; ··· 791 828 break; 792 829 case IW_PMKSA_FLUSH: 793 830 memset(psecuritypriv->PMKIDList, 0, 794 - sizeof(struct RT_PMKID_LIST) * NUM_PMKID_CACHE); 831 + sizeof(struct RT_PMKID_LIST) * NUM_PMKID_CACHE); 795 832 psecuritypriv->PMKIDIndex = 0; 796 833 intReturn = true; 797 834 break; ··· 813 850 return 0; 814 851 } 815 852 816 - static int r8711_wx_get_range(struct net_device *dev, 817 - struct iw_request_info *info, 818 - union iwreq_data *wrqu, char *extra) 853 + static int r8711_wx_get_range(struct net_device *dev, struct iw_request_info *info, 854 + union iwreq_data *wrqu, char *extra) 819 855 { 820 856 struct iw_range *range = (struct iw_range *)extra; 821 857 u16 val; ··· 874 912 union iwreq_data *wrqu, char *extra); 875 913 876 914 static int r871x_wx_set_priv(struct net_device *dev, 877 - struct iw_request_info *info, 878 - union iwreq_data *awrq, 879 - char *extra) 915 + struct iw_request_info *info, 916 + union iwreq_data *awrq, 917 + char *extra) 880 918 { 881 919 int ret = 0, len = 0; 882 920 char *ext; ··· 957 995 ); 958 996 sprintf(ext, "OK"); 959 997 } else { 960 - netdev_info(dev, "r8712u: %s: unknown Command %s.\n", 961 - __func__, ext); 998 + netdev_info(dev, "r8712u: %s: unknown Command %s.\n", __func__, ext); 962 999 goto FREE_EXT; 963 1000 } 964 - if (copy_to_user(dwrq->pointer, ext, 965 - min(dwrq->length, (__u16)(strlen(ext) + 1)))) 1001 + if (copy_to_user(dwrq->pointer, ext, min(dwrq->length, (__u16)(strlen(ext) + 1)))) 966 1002 ret = -EFAULT; 967 1003 968 1004 FREE_EXT: ··· 981 1021 * For this operation to succeed, there is no need for the interface to be up. 982 1022 * 983 1023 */ 984 - static int r8711_wx_set_wap(struct net_device *dev, 985 - struct iw_request_info *info, 986 - union iwreq_data *awrq, 987 - char *extra) 1024 + static int r8711_wx_set_wap(struct net_device *dev, struct iw_request_info *info, 1025 + union iwreq_data *awrq, char *extra) 988 1026 { 989 1027 int ret = -EINPROGRESS; 990 1028 struct _adapter *padapter = netdev_priv(dev); ··· 1030 1072 return ret; 1031 1073 } 1032 1074 1033 - static int r8711_wx_get_wap(struct net_device *dev, 1034 - struct iw_request_info *info, 1035 - union iwreq_data *wrqu, char *extra) 1075 + static int r8711_wx_get_wap(struct net_device *dev, struct iw_request_info *info, 1076 + union iwreq_data *wrqu, char *extra) 1036 1077 { 1037 1078 struct _adapter *padapter = netdev_priv(dev); 1038 1079 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 1039 1080 struct wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network; 1040 1081 1041 1082 wrqu->ap_addr.sa_family = ARPHRD_ETHER; 1042 - if (check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE | 1043 - WIFI_AP_STATE)) 1083 + if (check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE | WIFI_AP_STATE)) 1044 1084 ether_addr_copy(wrqu->ap_addr.sa_data, pcur_bss->MacAddress); 1045 1085 else 1046 1086 eth_zero_addr(wrqu->ap_addr.sa_data); ··· 1078 1122 * For this operation to succeed, the interface is brought Up beforehand. 1079 1123 * 1080 1124 */ 1081 - static int r8711_wx_set_scan(struct net_device *dev, 1082 - struct iw_request_info *a, 1083 - union iwreq_data *wrqu, char *extra) 1125 + static int r8711_wx_set_scan(struct net_device *dev, struct iw_request_info *a, 1126 + union iwreq_data *wrqu, char *extra) 1084 1127 { 1085 1128 struct _adapter *padapter = netdev_priv(dev); 1086 1129 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; ··· 1105 1150 unsigned long irqL; 1106 1151 u32 len = min_t(u8, req->essid_len, IW_ESSID_MAX_SIZE); 1107 1152 1108 - memset((unsigned char *)&ssid, 0, 1109 - sizeof(struct ndis_802_11_ssid)); 1153 + memset((unsigned char *)&ssid, 0, sizeof(struct ndis_802_11_ssid)); 1110 1154 memcpy(ssid.Ssid, req->essid, len); 1111 1155 ssid.SsidLength = len; 1112 1156 spin_lock_irqsave(&pmlmepriv->lock, irqL); ··· 1127 1173 return 0; 1128 1174 } 1129 1175 1130 - static int r8711_wx_get_scan(struct net_device *dev, 1131 - struct iw_request_info *a, 1132 - union iwreq_data *wrqu, char *extra) 1176 + static int r8711_wx_get_scan(struct net_device *dev, struct iw_request_info *a, 1177 + union iwreq_data *wrqu, char *extra) 1133 1178 { 1134 1179 struct _adapter *padapter = netdev_priv(dev); 1135 1180 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; ··· 1142 1189 1143 1190 if (padapter->driver_stopped) 1144 1191 return -EINVAL; 1145 - while (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | 1146 - _FW_UNDER_LINKING)) { 1192 + while (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | _FW_UNDER_LINKING)) { 1147 1193 msleep(30); 1148 1194 cnt++; 1149 1195 if (cnt > 100) ··· 1180 1228 * For this operation to succeed, there is no need for the interface to be Up. 1181 1229 * 1182 1230 */ 1183 - static int r8711_wx_set_essid(struct net_device *dev, 1184 - struct iw_request_info *a, 1185 - union iwreq_data *wrqu, char *extra) 1231 + static int r8711_wx_set_essid(struct net_device *dev, struct iw_request_info *a, 1232 + union iwreq_data *wrqu, char *extra) 1186 1233 { 1187 1234 struct _adapter *padapter = netdev_priv(dev); 1188 1235 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; ··· 1219 1268 if ((!memcmp(dst_ssid, src_ssid, ndis_ssid.SsidLength)) 1220 1269 && (pnetwork->network.Ssid.SsidLength == 1221 1270 ndis_ssid.SsidLength)) { 1222 - if (check_fwstate(pmlmepriv, 1223 - WIFI_ADHOC_STATE)) { 1271 + if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { 1224 1272 if (pnetwork->network. 1225 1273 InfrastructureMode 1226 1274 != ··· 1241 1291 return -EINPROGRESS; 1242 1292 } 1243 1293 1244 - static int r8711_wx_get_essid(struct net_device *dev, 1245 - struct iw_request_info *a, 1246 - union iwreq_data *wrqu, char *extra) 1294 + static int r8711_wx_get_essid(struct net_device *dev, struct iw_request_info *a, 1295 + union iwreq_data *wrqu, char *extra) 1247 1296 { 1248 1297 struct _adapter *padapter = netdev_priv(dev); 1249 1298 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; ··· 1260 1311 return ret; 1261 1312 } 1262 1313 1263 - static int r8711_wx_set_rate(struct net_device *dev, 1264 - struct iw_request_info *a, 1265 - union iwreq_data *wrqu, char *extra) 1314 + static int r8711_wx_set_rate(struct net_device *dev, struct iw_request_info *a, 1315 + union iwreq_data *wrqu, char *extra) 1266 1316 { 1267 1317 struct _adapter *padapter = netdev_priv(dev); 1268 1318 u32 target_rate = wrqu->bitrate.value; ··· 1330 1382 return r8712_setdatarate_cmd(padapter, datarates); 1331 1383 } 1332 1384 1333 - static int r8711_wx_get_rate(struct net_device *dev, 1334 - struct iw_request_info *info, 1385 + static int r8711_wx_get_rate(struct net_device *dev, struct iw_request_info *info, 1335 1386 union iwreq_data *wrqu, char *extra) 1336 1387 { 1337 1388 struct _adapter *padapter = netdev_priv(dev); ··· 1384 1437 return 0; 1385 1438 } 1386 1439 1387 - static int r8711_wx_get_rts(struct net_device *dev, 1388 - struct iw_request_info *info, 1389 - union iwreq_data *wrqu, char *extra) 1440 + static int r8711_wx_get_rts(struct net_device *dev, struct iw_request_info *info, 1441 + union iwreq_data *wrqu, char *extra) 1390 1442 { 1391 1443 struct _adapter *padapter = netdev_priv(dev); 1392 1444 ··· 1394 1448 return 0; 1395 1449 } 1396 1450 1397 - static int r8711_wx_set_frag(struct net_device *dev, 1398 - struct iw_request_info *info, 1399 - union iwreq_data *wrqu, char *extra) 1451 + static int r8711_wx_set_frag(struct net_device *dev, struct iw_request_info *info, 1452 + union iwreq_data *wrqu, char *extra) 1400 1453 { 1401 1454 struct _adapter *padapter = netdev_priv(dev); 1402 1455
+1 -1
drivers/staging/rtl8712/rtl871x_mp_phy_regdef.h
··· 126 126 #define rFPGA0_AnalogParameter3 0x888 /* Useless now */ 127 127 #define rFPGA0_AnalogParameter4 0x88c 128 128 129 - #define rFPGA0_XA_LSSIReadBack 0x8a0 /* Tranceiver LSSI Readback */ 129 + #define rFPGA0_XA_LSSIReadBack 0x8a0 /* Transceiver LSSI Readback */ 130 130 #define rFPGA0_XB_LSSIReadBack 0x8a4 131 131 #define rFPGA0_XC_LSSIReadBack 0x8a8 132 132 #define rFPGA0_XD_LSSIReadBack 0x8ac
-5
drivers/staging/vc04_services/interface/TODO
··· 23 23 resources must be freed (kthreads, debugfs entries, ...) and global 24 24 variables avoided. 25 25 26 - * Cleanup logging mechanism 27 - 28 - The driver should probably be using the standard kernel logging mechanisms 29 - such as dev_info, dev_dbg, and friends. 30 - 31 26 * Documentation 32 27 33 28 A short top-down description of this driver's architecture (function of
+94 -177
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
··· 255 255 pagelist = dma_alloc_coherent(instance->state->dev, pagelist_size, &dma_addr, 256 256 GFP_KERNEL); 257 257 258 - vchiq_log_trace(instance->state->dev, VCHIQ_ARM, 259 - "%s - %pK", __func__, pagelist); 258 + dev_dbg(instance->state->dev, "arm: %pK\n", pagelist); 260 259 261 260 if (!pagelist) 262 261 return NULL; ··· 310 311 type == PAGELIST_READ, pages); 311 312 312 313 if (actual_pages != num_pages) { 313 - vchiq_log_debug(instance->state->dev, VCHIQ_ARM, 314 - "%s - only %d/%d pages locked", 315 - __func__, actual_pages, num_pages); 314 + dev_dbg(instance->state->dev, "arm: Only %d/%d pages locked\n", 315 + actual_pages, num_pages); 316 316 317 317 /* This is probably due to the process being killed */ 318 318 if (actual_pages > 0) ··· 405 407 struct page **pages = pagelistinfo->pages; 406 408 unsigned int num_pages = pagelistinfo->num_pages; 407 409 408 - vchiq_log_trace(instance->state->dev, VCHIQ_ARM, 409 - "%s - %pK, %d", __func__, pagelistinfo->pagelist, actual); 410 + dev_dbg(instance->state->dev, "arm: %pK, %d\n", pagelistinfo->pagelist, actual); 410 411 411 412 /* 412 413 * NOTE: dma_unmap_sg must be called before the ··· 553 556 return -ENXIO; 554 557 } 555 558 556 - vchiq_log_debug(&pdev->dev, VCHIQ_ARM, "vchiq_init - done (slots %pK, phys %pad)", 557 - vchiq_slot_zero, &slot_phys); 559 + dev_dbg(&pdev->dev, "arm: vchiq_init - done (slots %pK, phys %pad)\n", 560 + vchiq_slot_zero, &slot_phys); 558 561 559 562 vchiq_call_connected_callbacks(); 560 563 ··· 656 659 bulk->actual); 657 660 } 658 661 659 - int vchiq_dump_platform_state(void *dump_context) 662 + void vchiq_dump_platform_state(struct seq_file *f) 660 663 { 661 - char buf[80]; 662 - int len; 663 - 664 - len = snprintf(buf, sizeof(buf), " Platform: 2835 (VC master)"); 665 - return vchiq_dump(dump_context, buf, len + 1); 664 + seq_puts(f, " Platform: 2835 (VC master)\n"); 666 665 } 667 666 668 667 #define VCHIQ_INIT_RETRIES 10 ··· 680 687 usleep_range(500, 600); 681 688 } 682 689 if (i == VCHIQ_INIT_RETRIES) { 683 - vchiq_log_error(state->dev, VCHIQ_CORE, "%s: videocore not initialized\n", 684 - __func__); 690 + dev_err(state->dev, "core: %s: Videocore not initialized\n", __func__); 685 691 ret = -ENOTCONN; 686 692 goto failed; 687 693 } else if (i > 0) { 688 - vchiq_log_warning(state->dev, VCHIQ_CORE, 689 - "%s: videocore initialized after %d retries\n", __func__, i); 694 + dev_warn(state->dev, "core: %s: videocore initialized after %d retries\n", 695 + __func__, i); 690 696 } 691 697 692 698 instance = kzalloc(sizeof(*instance), GFP_KERNEL); 693 699 if (!instance) { 694 - vchiq_log_error(state->dev, VCHIQ_CORE, 695 - "%s: error allocating vchiq instance\n", __func__); 700 + dev_err(state->dev, "core: %s: Cannot allocate vchiq instance\n", __func__); 696 701 ret = -ENOMEM; 697 702 goto failed; 698 703 } ··· 705 714 ret = 0; 706 715 707 716 failed: 708 - vchiq_log_trace(state->dev, VCHIQ_CORE, 709 - "%s(%p): returning %d", __func__, instance, ret); 717 + dev_dbg(state->dev, "core: (%p): returning %d\n", instance, ret); 710 718 711 719 return ret; 712 720 } ··· 718 728 list_for_each_entry_safe(waiter, next, 719 729 &instance->bulk_waiter_list, list) { 720 730 list_del(&waiter->list); 721 - vchiq_log_debug(instance->state->dev, VCHIQ_ARM, 722 - "bulk_waiter - cleaned up %pK for pid %d", 723 - waiter, waiter->pid); 731 + dev_dbg(instance->state->dev, 732 + "arm: bulk_waiter - cleaned up %pK for pid %d\n", 733 + waiter, waiter->pid); 724 734 kfree(waiter); 725 735 } 726 736 } ··· 738 748 739 749 mutex_unlock(&state->mutex); 740 750 741 - vchiq_log_trace(state->dev, VCHIQ_CORE, 742 - "%s(%p): returning %d", __func__, instance, status); 751 + dev_dbg(state->dev, "core: (%p): returning %d\n", instance, status); 743 752 744 753 free_bulk_waiter(instance); 745 754 kfree(instance); ··· 758 769 struct vchiq_state *state = instance->state; 759 770 760 771 if (mutex_lock_killable(&state->mutex)) { 761 - vchiq_log_trace(state->dev, VCHIQ_CORE, 762 - "%s: call to mutex_lock failed", __func__); 772 + dev_dbg(state->dev, 773 + "core: call to mutex_lock failed\n"); 763 774 status = -EAGAIN; 764 775 goto failed; 765 776 } ··· 771 782 mutex_unlock(&state->mutex); 772 783 773 784 failed: 774 - vchiq_log_trace(state->dev, VCHIQ_CORE, 775 - "%s(%p): returning %d", __func__, instance, status); 785 + dev_dbg(state->dev, "core: (%p): returning %d\n", instance, status); 776 786 777 787 return status; 778 788 } ··· 802 814 status = -EINVAL; 803 815 } 804 816 805 - vchiq_log_trace(state->dev, VCHIQ_CORE, 806 - "%s(%p): returning %d", __func__, instance, status); 817 + dev_dbg(state->dev, "core: (%p): returning %d\n", instance, status); 807 818 808 819 return status; 809 820 } ··· 833 846 } 834 847 835 848 failed: 836 - vchiq_log_trace(state->dev, VCHIQ_CORE, 837 - "%s(%p): returning %d", __func__, instance, status); 849 + dev_dbg(state->dev, "core: (%p): returning %d\n", instance, status); 838 850 839 851 return status; 840 852 } ··· 957 971 } else { 958 972 waiter = kzalloc(sizeof(*waiter), GFP_KERNEL); 959 973 if (!waiter) { 960 - vchiq_log_error(service->state->dev, VCHIQ_CORE, 961 - "%s - out of memory", __func__); 974 + dev_err(service->state->dev, "core: %s: - Out of memory\n", __func__); 962 975 return -ENOMEM; 963 976 } 964 977 } ··· 980 995 mutex_lock(&instance->bulk_waiter_list_mutex); 981 996 list_add(&waiter->list, &instance->bulk_waiter_list); 982 997 mutex_unlock(&instance->bulk_waiter_list_mutex); 983 - vchiq_log_debug(instance->state->dev, VCHIQ_ARM, 984 - "saved bulk_waiter %pK for pid %d", waiter, 985 - current->pid); 998 + dev_dbg(instance->state->dev, "arm: saved bulk_waiter %pK for pid %d\n", 999 + waiter, current->pid); 986 1000 } 987 1001 988 1002 return status; ··· 1001 1017 while ((insert - instance->completion_remove) >= MAX_COMPLETIONS) { 1002 1018 /* Out of space - wait for the client */ 1003 1019 DEBUG_TRACE(SERVICE_CALLBACK_LINE); 1004 - vchiq_log_trace(instance->state->dev, VCHIQ_CORE, 1005 - "%s - completion queue full", __func__); 1020 + dev_dbg(instance->state->dev, "core: completion queue full\n"); 1006 1021 DEBUG_COUNT(COMPLETION_QUEUE_FULL_COUNT); 1007 1022 if (wait_for_completion_interruptible(&instance->remove_event)) { 1008 - vchiq_log_debug(instance->state->dev, VCHIQ_ARM, 1009 - "service_callback interrupted"); 1023 + dev_dbg(instance->state->dev, "arm: service_callback interrupted\n"); 1010 1024 return -EAGAIN; 1011 1025 } else if (instance->closing) { 1012 - vchiq_log_debug(instance->state->dev, VCHIQ_ARM, 1013 - "service_callback closing"); 1026 + dev_dbg(instance->state->dev, "arm: service_callback closing\n"); 1014 1027 return 0; 1015 1028 } 1016 1029 DEBUG_TRACE(SERVICE_CALLBACK_LINE); ··· 1087 1106 vchiq_service_get(service); 1088 1107 rcu_read_unlock(); 1089 1108 1090 - vchiq_log_trace(service->state->dev, VCHIQ_ARM, 1091 - "%s - service %lx(%d,%p), reason %d, header %lx, instance %lx, bulk_userdata %lx", 1092 - __func__, (unsigned long)user_service, service->localport, 1093 - user_service->userdata, reason, (unsigned long)header, 1094 - (unsigned long)instance, (unsigned long)bulk_userdata); 1109 + dev_dbg(service->state->dev, 1110 + "arm: service %p(%d,%p), reason %d, header %p, instance %p, bulk_userdata %p\n", 1111 + user_service, service->localport, user_service->userdata, 1112 + reason, header, instance, bulk_userdata); 1095 1113 1096 1114 if (header && user_service->is_vchi) { 1097 1115 spin_lock(&msg_queue_spinlock); ··· 1099 1119 spin_unlock(&msg_queue_spinlock); 1100 1120 DEBUG_TRACE(SERVICE_CALLBACK_LINE); 1101 1121 DEBUG_COUNT(MSG_QUEUE_FULL_COUNT); 1102 - vchiq_log_trace(service->state->dev, VCHIQ_ARM, 1103 - "%s - msg queue full", __func__); 1122 + dev_dbg(service->state->dev, "arm: msg queue full\n"); 1104 1123 /* 1105 1124 * If there is no MESSAGE_AVAILABLE in the completion 1106 1125 * queue, add one ··· 1108 1129 instance->completion_remove) < 0) { 1109 1130 int status; 1110 1131 1111 - vchiq_log_debug(instance->state->dev, VCHIQ_ARM, 1112 - "Inserting extra MESSAGE_AVAILABLE"); 1132 + dev_dbg(instance->state->dev, 1133 + "arm: Inserting extra MESSAGE_AVAILABLE\n"); 1113 1134 DEBUG_TRACE(SERVICE_CALLBACK_LINE); 1114 1135 status = add_completion(instance, reason, NULL, user_service, 1115 1136 bulk_userdata); ··· 1122 1143 1123 1144 DEBUG_TRACE(SERVICE_CALLBACK_LINE); 1124 1145 if (wait_for_completion_interruptible(&user_service->remove_event)) { 1125 - vchiq_log_debug(instance->state->dev, VCHIQ_ARM, 1126 - "%s interrupted", __func__); 1146 + dev_dbg(instance->state->dev, "arm: interrupted\n"); 1127 1147 DEBUG_TRACE(SERVICE_CALLBACK_LINE); 1128 1148 vchiq_service_put(service); 1129 1149 return -EAGAIN; 1130 1150 } else if (instance->closing) { 1131 - vchiq_log_debug(instance->state->dev, VCHIQ_ARM, 1132 - "%s closing", __func__); 1151 + dev_dbg(instance->state->dev, "arm: closing\n"); 1133 1152 DEBUG_TRACE(SERVICE_CALLBACK_LINE); 1134 1153 vchiq_service_put(service); 1135 1154 return -EINVAL; ··· 1167 1190 bulk_userdata); 1168 1191 } 1169 1192 1170 - int vchiq_dump(void *dump_context, const char *str, int len) 1171 - { 1172 - struct dump_context *context = (struct dump_context *)dump_context; 1173 - int copy_bytes; 1174 - 1175 - if (context->actual >= context->space) 1176 - return 0; 1177 - 1178 - if (context->offset > 0) { 1179 - int skip_bytes = min_t(int, len, context->offset); 1180 - 1181 - str += skip_bytes; 1182 - len -= skip_bytes; 1183 - context->offset -= skip_bytes; 1184 - if (context->offset > 0) 1185 - return 0; 1186 - } 1187 - copy_bytes = min_t(int, len, context->space - context->actual); 1188 - if (copy_bytes == 0) 1189 - return 0; 1190 - if (copy_to_user(context->buf + context->actual, str, 1191 - copy_bytes)) 1192 - return -EFAULT; 1193 - context->actual += copy_bytes; 1194 - len -= copy_bytes; 1195 - 1196 - /* 1197 - * If the terminating NUL is included in the length, then it 1198 - * marks the end of a line and should be replaced with a 1199 - * carriage return. 1200 - */ 1201 - if ((len == 0) && (str[copy_bytes - 1] == '\0')) { 1202 - char cr = '\n'; 1203 - 1204 - if (copy_to_user(context->buf + context->actual - 1, 1205 - &cr, 1)) 1206 - return -EFAULT; 1207 - } 1208 - return 0; 1209 - } 1210 - 1211 - int vchiq_dump_platform_instances(void *dump_context) 1193 + void vchiq_dump_platform_instances(struct seq_file *f) 1212 1194 { 1213 1195 struct vchiq_state *state = vchiq_get_state(); 1214 - char buf[80]; 1215 - int len; 1216 1196 int i; 1217 1197 1218 1198 if (!state) 1219 - return -ENOTCONN; 1199 + return; 1220 1200 1221 1201 /* 1222 1202 * There is no list of instances, so instead scan all services, ··· 1198 1264 for (i = 0; i < state->unused_service; i++) { 1199 1265 struct vchiq_service *service; 1200 1266 struct vchiq_instance *instance; 1201 - int err; 1202 1267 1203 1268 rcu_read_lock(); 1204 1269 service = rcu_dereference(state->services[i]); ··· 1213 1280 } 1214 1281 rcu_read_unlock(); 1215 1282 1216 - len = snprintf(buf, sizeof(buf), 1217 - "Instance %pK: pid %d,%s completions %d/%d", 1218 - instance, instance->pid, 1219 - instance->connected ? " connected, " : 1220 - "", 1221 - instance->completion_insert - 1222 - instance->completion_remove, 1223 - MAX_COMPLETIONS); 1224 - err = vchiq_dump(dump_context, buf, len + 1); 1225 - if (err) 1226 - return err; 1283 + seq_printf(f, "Instance %pK: pid %d,%s completions %d/%d\n", 1284 + instance, instance->pid, 1285 + instance->connected ? " connected, " : 1286 + "", 1287 + instance->completion_insert - 1288 + instance->completion_remove, 1289 + MAX_COMPLETIONS); 1227 1290 instance->mark = 1; 1228 1291 } 1229 - return 0; 1230 1292 } 1231 1293 1232 - int vchiq_dump_platform_service_state(void *dump_context, 1233 - struct vchiq_service *service) 1294 + void vchiq_dump_platform_service_state(struct seq_file *f, 1295 + struct vchiq_service *service) 1234 1296 { 1235 1297 struct user_service *user_service = 1236 1298 (struct user_service *)service->base.userdata; 1237 - char buf[80]; 1238 - int len; 1239 1299 1240 - len = scnprintf(buf, sizeof(buf), " instance %pK", service->instance); 1300 + seq_printf(f, " instance %pK", service->instance); 1241 1301 1242 1302 if ((service->base.callback == service_callback) && user_service->is_vchi) { 1243 - len += scnprintf(buf + len, sizeof(buf) - len, ", %d/%d messages", 1244 - user_service->msg_insert - user_service->msg_remove, 1245 - MSG_QUEUE_SIZE); 1303 + seq_printf(f, ", %d/%d messages", 1304 + user_service->msg_insert - user_service->msg_remove, 1305 + MSG_QUEUE_SIZE); 1246 1306 1247 1307 if (user_service->dequeue_pending) 1248 - len += scnprintf(buf + len, sizeof(buf) - len, 1249 - " (dequeue pending)"); 1308 + seq_puts(f, " (dequeue pending)"); 1250 1309 } 1251 1310 1252 - return vchiq_dump(dump_context, buf, len + 1); 1311 + seq_puts(f, "\n"); 1253 1312 } 1254 1313 1255 1314 struct vchiq_state * ··· 1271 1346 struct vchiq_header *header, 1272 1347 unsigned int service_user, void *bulk_user) 1273 1348 { 1274 - vchiq_log_error(instance->state->dev, VCHIQ_SUSPEND, 1275 - "%s callback reason %d", __func__, reason); 1349 + dev_err(instance->state->dev, "suspend: %s: callback reason %d\n", 1350 + __func__, reason); 1276 1351 return 0; 1277 1352 } 1278 1353 ··· 1296 1371 1297 1372 ret = vchiq_initialise(&instance); 1298 1373 if (ret) { 1299 - vchiq_log_error(state->dev, VCHIQ_SUSPEND, 1300 - "%s vchiq_initialise failed %d", __func__, ret); 1374 + dev_err(state->dev, "suspend: %s: vchiq_initialise failed %d\n", __func__, ret); 1301 1375 goto exit; 1302 1376 } 1303 1377 1304 1378 status = vchiq_connect(instance); 1305 1379 if (status) { 1306 - vchiq_log_error(state->dev, VCHIQ_SUSPEND, 1307 - "%s vchiq_connect failed %d", __func__, status); 1380 + dev_err(state->dev, "suspend: %s: vchiq_connect failed %d\n", __func__, status); 1308 1381 goto shutdown; 1309 1382 } 1310 1383 1311 1384 status = vchiq_add_service(instance, &params, &ka_handle); 1312 1385 if (status) { 1313 - vchiq_log_error(state->dev, VCHIQ_SUSPEND, 1314 - "%s vchiq_open_service failed %d", __func__, status); 1386 + dev_err(state->dev, "suspend: %s: vchiq_open_service failed %d\n", 1387 + __func__, status); 1315 1388 goto shutdown; 1316 1389 } 1317 1390 ··· 1317 1394 long rc = 0, uc = 0; 1318 1395 1319 1396 if (wait_for_completion_interruptible(&arm_state->ka_evt)) { 1320 - vchiq_log_error(state->dev, VCHIQ_SUSPEND, 1321 - "%s interrupted", __func__); 1397 + dev_err(state->dev, "suspend: %s: interrupted\n", __func__); 1322 1398 flush_signals(current); 1323 1399 continue; 1324 1400 } ··· 1337 1415 atomic_inc(&arm_state->ka_use_ack_count); 1338 1416 status = vchiq_use_service(instance, ka_handle); 1339 1417 if (status) { 1340 - vchiq_log_error(state->dev, VCHIQ_SUSPEND, 1341 - "%s vchiq_use_service error %d", __func__, status); 1418 + dev_err(state->dev, "suspend: %s: vchiq_use_service error %d\n", 1419 + __func__, status); 1342 1420 } 1343 1421 } 1344 1422 while (rc--) { 1345 1423 status = vchiq_release_service(instance, ka_handle); 1346 1424 if (status) { 1347 - vchiq_log_error(state->dev, VCHIQ_SUSPEND, 1348 - "%s vchiq_release_service error %d", __func__, 1349 - status); 1425 + dev_err(state->dev, "suspend: %s: vchiq_release_service error %d\n", 1426 + __func__, status); 1350 1427 } 1351 1428 } 1352 1429 } ··· 1380 1459 service->client_id); 1381 1460 entity_uc = &service->service_use_count; 1382 1461 } else { 1383 - vchiq_log_error(state->dev, VCHIQ_SUSPEND, "%s null service ptr", __func__); 1462 + dev_err(state->dev, "suspend: %s: null service ptr\n", __func__); 1384 1463 ret = -EINVAL; 1385 1464 goto out; 1386 1465 } ··· 1389 1468 local_uc = ++arm_state->videocore_use_count; 1390 1469 ++(*entity_uc); 1391 1470 1392 - vchiq_log_trace(state->dev, VCHIQ_SUSPEND, "%s %s count %d, state count %d", 1393 - __func__, entity, *entity_uc, local_uc); 1471 + dev_dbg(state->dev, "suspend: %s count %d, state count %d\n", 1472 + entity, *entity_uc, local_uc); 1394 1473 1395 1474 write_unlock_bh(&arm_state->susp_res_lock); 1396 1475 ··· 1409 1488 } 1410 1489 1411 1490 out: 1412 - vchiq_log_trace(state->dev, VCHIQ_SUSPEND, "%s exit %d", __func__, ret); 1491 + dev_dbg(state->dev, "suspend: exit %d\n", ret); 1413 1492 return ret; 1414 1493 } 1415 1494 ··· 1447 1526 --arm_state->videocore_use_count; 1448 1527 --(*entity_uc); 1449 1528 1450 - vchiq_log_trace(state->dev, VCHIQ_SUSPEND, "%s %s count %d, state count %d", 1451 - __func__, entity, *entity_uc, arm_state->videocore_use_count); 1529 + dev_dbg(state->dev, "suspend: %s count %d, state count %d\n", 1530 + entity, *entity_uc, arm_state->videocore_use_count); 1452 1531 1453 1532 unlock: 1454 1533 write_unlock_bh(&arm_state->susp_res_lock); 1455 1534 1456 1535 out: 1457 - vchiq_log_trace(state->dev, VCHIQ_SUSPEND, "%s exit %d", __func__, ret); 1536 + dev_dbg(state->dev, "suspend: exit %d\n", ret); 1458 1537 return ret; 1459 1538 } 1460 1539 ··· 1628 1707 read_unlock_bh(&arm_state->susp_res_lock); 1629 1708 1630 1709 if (only_nonzero) 1631 - vchiq_log_warning(state->dev, VCHIQ_SUSPEND, 1632 - "Too many active services (%d). Only dumping up to first %d services with non-zero use-count", 1633 - active_services, found); 1710 + dev_warn(state->dev, 1711 + "suspend: Too many active services (%d). Only dumping up to first %d services with non-zero use-count\n", 1712 + active_services, found); 1634 1713 1635 1714 for (i = 0; i < found; i++) { 1636 - vchiq_log_warning(state->dev, VCHIQ_SUSPEND, 1637 - "%p4cc:%d service count %d %s", 1638 - &service_data[i].fourcc, 1639 - service_data[i].clientid, service_data[i].use_count, 1640 - service_data[i].use_count ? nz : ""); 1715 + dev_warn(state->dev, 1716 + "suspend: %p4cc:%d service count %d %s\n", 1717 + &service_data[i].fourcc, 1718 + service_data[i].clientid, service_data[i].use_count, 1719 + service_data[i].use_count ? nz : ""); 1641 1720 } 1642 - vchiq_log_warning(state->dev, VCHIQ_SUSPEND, "VCHIQ use count %d", peer_count); 1643 - vchiq_log_warning(state->dev, VCHIQ_SUSPEND, "Overall vchiq instance use count %d", 1644 - vc_use_count); 1721 + dev_warn(state->dev, "suspend: VCHIQ use count %d\n", peer_count); 1722 + dev_warn(state->dev, "suspend: Overall vchiq instance use count %d\n", vc_use_count); 1645 1723 1646 1724 kfree(service_data); 1647 1725 } ··· 1662 1742 read_unlock_bh(&arm_state->susp_res_lock); 1663 1743 1664 1744 if (ret) { 1665 - vchiq_log_error(service->state->dev, VCHIQ_SUSPEND, 1666 - "%s ERROR - %p4cc:%d service count %d, state count %d", __func__, 1667 - &service->base.fourcc, service->client_id, 1668 - service->service_use_count, arm_state->videocore_use_count); 1745 + dev_err(service->state->dev, 1746 + "suspend: %s: %p4cc:%d service count %d, state count %d\n", 1747 + __func__, &service->base.fourcc, service->client_id, 1748 + service->service_use_count, arm_state->videocore_use_count); 1669 1749 vchiq_dump_service_use_state(service->state); 1670 1750 } 1671 1751 out: ··· 1679 1759 struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state); 1680 1760 char threadname[16]; 1681 1761 1682 - vchiq_log_debug(state->dev, VCHIQ_SUSPEND, "%d: %s->%s", state->id, 1683 - get_conn_state_name(oldstate), get_conn_state_name(newstate)); 1762 + dev_dbg(state->dev, "suspend: %d: %s->%s\n", 1763 + state->id, get_conn_state_name(oldstate), get_conn_state_name(newstate)); 1684 1764 if (state->conn_state != VCHIQ_CONNSTATE_CONNECTED) 1685 1765 return; 1686 1766 ··· 1698 1778 (void *)state, 1699 1779 threadname); 1700 1780 if (IS_ERR(arm_state->ka_thread)) { 1701 - vchiq_log_error(state->dev, VCHIQ_SUSPEND, 1702 - "vchiq: FATAL: couldn't create thread %s", 1703 - threadname); 1781 + dev_err(state->dev, "suspend: Couldn't create thread %s\n", 1782 + threadname); 1704 1783 } else { 1705 1784 wake_up_process(arm_state->ka_thread); 1706 1785 } ··· 1744 1825 1745 1826 vchiq_debugfs_init(); 1746 1827 1747 - vchiq_log_debug(&pdev->dev, VCHIQ_ARM, 1748 - "vchiq: platform initialised - version %d (min %d)", 1749 - VCHIQ_VERSION, VCHIQ_VERSION_MIN); 1828 + dev_dbg(&pdev->dev, "arm: platform initialised - version %d (min %d)\n", 1829 + VCHIQ_VERSION, VCHIQ_VERSION_MIN); 1750 1830 1751 1831 /* 1752 1832 * Simply exit on error since the function handles cleanup in ··· 1753 1835 */ 1754 1836 err = vchiq_register_chrdev(&pdev->dev); 1755 1837 if (err) { 1756 - vchiq_log_warning(&pdev->dev, VCHIQ_ARM, 1757 - "Failed to initialize vchiq cdev"); 1838 + dev_warn(&pdev->dev, "arm: Failed to initialize vchiq cdev\n"); 1758 1839 goto error_exit; 1759 1840 } 1760 1841 ··· 1763 1846 return 0; 1764 1847 1765 1848 failed_platform_init: 1766 - vchiq_log_warning(&pdev->dev, VCHIQ_ARM, "could not initialize vchiq platform"); 1849 + dev_warn(&pdev->dev, "arm: Could not initialize vchiq platform\n"); 1767 1850 error_exit: 1768 1851 return err; 1769 1852 }
-7
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
··· 69 69 struct vchiq_debugfs_node debugfs_node; 70 70 }; 71 71 72 - struct dump_context { 73 - char __user *buf; 74 - size_t actual; 75 - size_t space; 76 - loff_t offset; 77 - }; 78 - 79 72 extern spinlock_t msg_queue_spinlock; 80 73 extern struct vchiq_state g_state; 81 74
+4 -4
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
··· 27 27 * be made immediately, otherwise it will be deferred until 28 28 * vchiq_call_connected_callbacks is called. 29 29 */ 30 - void vchiq_add_connected_callback(void (*callback)(void)) 30 + void vchiq_add_connected_callback(struct vchiq_device *device, void (*callback)(void)) 31 31 { 32 32 connected_init(); 33 33 ··· 39 39 callback(); 40 40 } else { 41 41 if (g_num_deferred_callbacks >= MAX_CALLBACKS) { 42 - vchiq_log_error(NULL, VCHIQ_CORE, 43 - "There already %d callback registered - please increase MAX_CALLBACKS", 44 - g_num_deferred_callbacks); 42 + dev_err(&device->dev, 43 + "core: There already %d callback registered - please increase MAX_CALLBACKS\n", 44 + g_num_deferred_callbacks); 45 45 } else { 46 46 g_deferred_callback[g_num_deferred_callbacks] = 47 47 callback;
+3 -1
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 2 2 /* Copyright (c) 2010-2012 Broadcom. All rights reserved. */ 3 3 4 + #include "vchiq_bus.h" 5 + 4 6 #ifndef VCHIQ_CONNECTED_H 5 7 #define VCHIQ_CONNECTED_H 6 8 7 - void vchiq_add_connected_callback(void (*callback)(void)); 9 + void vchiq_add_connected_callback(struct vchiq_device *device, void (*callback)(void)); 8 10 void vchiq_call_connected_callbacks(void); 9 11 10 12 #endif /* VCHIQ_CONNECTED_H */
+287 -377
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
··· 217 217 static inline void 218 218 set_service_state(struct vchiq_service *service, int newstate) 219 219 { 220 - vchiq_log_debug(service->state->dev, VCHIQ_CORE, "%d: srv:%d %s->%s", 221 - service->state->id, service->localport, 222 - srvstate_names[service->srvstate], 223 - srvstate_names[newstate]); 220 + dev_dbg(service->state->dev, "core: %d: srv:%d %s->%s\n", 221 + service->state->id, service->localport, 222 + srvstate_names[service->srvstate], 223 + srvstate_names[newstate]); 224 224 service->srvstate = newstate; 225 225 } 226 226 ··· 245 245 return service; 246 246 } 247 247 rcu_read_unlock(); 248 - vchiq_log_debug(service->state->dev, VCHIQ_CORE, 249 - "Invalid service handle 0x%x", handle); 248 + dev_dbg(instance->state->dev, "core: Invalid service handle 0x%x\n", handle); 250 249 return NULL; 251 250 } 252 251 ··· 265 266 } 266 267 rcu_read_unlock(); 267 268 } 268 - vchiq_log_debug(state->dev, VCHIQ_CORE, 269 - "Invalid port %u", localport); 269 + dev_dbg(state->dev, "core: Invalid port %u\n", localport); 270 270 return NULL; 271 271 } 272 272 ··· 285 287 return service; 286 288 } 287 289 rcu_read_unlock(); 288 - vchiq_log_debug(service->state->dev, VCHIQ_CORE, 289 - "Invalid service handle 0x%x", handle); 290 + dev_dbg(instance->state->dev, "core: Invalid service handle 0x%x\n", handle); 290 291 return NULL; 291 292 } 292 293 ··· 307 310 return service; 308 311 } 309 312 rcu_read_unlock(); 310 - vchiq_log_debug(service->state->dev, VCHIQ_CORE, 311 - "Invalid service handle 0x%x", handle); 313 + dev_dbg(instance->state->dev, "core: Invalid service handle 0x%x\n", handle); 312 314 return service; 313 315 } 314 316 ··· 455 459 { 456 460 int status; 457 461 458 - vchiq_log_trace(service->state->dev, VCHIQ_CORE, "%d: callback:%d (%s, %pK, %pK)", 459 - service->state->id, service->localport, reason_names[reason], 460 - header, bulk_userdata); 462 + dev_dbg(service->state->dev, "core: %d: callback:%d (%s, %pK, %pK)\n", 463 + service->state->id, service->localport, reason_names[reason], 464 + header, bulk_userdata); 461 465 status = service->base.callback(service->instance, reason, header, service->handle, 462 466 bulk_userdata); 463 467 if (status && (status != -EAGAIN)) { 464 - vchiq_log_warning(service->state->dev, VCHIQ_CORE, 465 - "%d: ignoring ERROR from callback to service %x", 466 - service->state->id, service->handle); 468 + dev_warn(service->state->dev, 469 + "core: %d: ignoring ERROR from callback to service %x\n", 470 + service->state->id, service->handle); 467 471 status = 0; 468 472 } 469 473 ··· 478 482 { 479 483 enum vchiq_connstate oldstate = state->conn_state; 480 484 481 - vchiq_log_debug(state->dev, VCHIQ_CORE, "%d: %s->%s", state->id, conn_state_names[oldstate], 482 - conn_state_names[newstate]); 485 + dev_dbg(state->dev, "core: %d: %s->%s\n", 486 + state->id, conn_state_names[oldstate], conn_state_names[newstate]); 483 487 state->conn_state = newstate; 484 488 vchiq_platform_conn_state_changed(state, oldstate, newstate); 485 489 } ··· 737 741 */ 738 742 complete(&quota->quota_event); 739 743 } else if (count == 0) { 740 - vchiq_log_error(state->dev, VCHIQ_CORE, 741 - "service %d message_use_count=%d (header %pK, msgid %x, header->msgid %x, header->size %x)", 742 - port, quota->message_use_count, header, msgid, header->msgid, 743 - header->size); 744 + dev_err(state->dev, 745 + "core: service %d message_use_count=%d (header %pK, msgid %x, header->msgid %x, header->size %x)\n", 746 + port, quota->message_use_count, header, msgid, 747 + header->msgid, header->size); 744 748 WARN(1, "invalid message use count\n"); 745 749 } 746 750 if (!BITSET_IS_SET(service_found, port)) { ··· 759 763 * it has dropped below its quota 760 764 */ 761 765 complete(&quota->quota_event); 762 - vchiq_log_trace(state->dev, VCHIQ_CORE, "%d: pfq:%d %x@%pK - slot_use->%d", 763 - state->id, port, header->size, header, count - 1); 766 + dev_dbg(state->dev, "core: %d: pfq:%d %x@%pK - slot_use->%d\n", 767 + state->id, port, header->size, header, count - 1); 764 768 } else { 765 - vchiq_log_error(state->dev, VCHIQ_CORE, 766 - "service %d slot_use_count=%d (header %pK, msgid %x, header->msgid %x, header->size %x)", 767 - port, count, header, msgid, header->msgid, header->size); 769 + dev_err(state->dev, 770 + "core: service %d slot_use_count=%d (header %pK, msgid %x, header->msgid %x, header->size %x)\n", 771 + port, count, header, msgid, header->msgid, header->size); 768 772 WARN(1, "bad slot use count\n"); 769 773 } 770 774 } ··· 805 809 */ 806 810 rmb(); 807 811 808 - vchiq_log_trace(state->dev, VCHIQ_CORE, "%d: pfq %d=%pK %x %x", 809 - state->id, slot_index, data, local->slot_queue_recycle, 810 - slot_queue_available); 812 + dev_dbg(state->dev, "core: %d: pfq %d=%pK %x %x\n", 813 + state->id, slot_index, data, local->slot_queue_recycle, 814 + slot_queue_available); 811 815 812 816 /* Initialise the bitmask for services which have used this slot */ 813 817 memset(service_found, 0, length); ··· 827 831 828 832 pos += calc_stride(header->size); 829 833 if (pos > VCHIQ_SLOT_SIZE) { 830 - vchiq_log_error(state->dev, VCHIQ_CORE, 831 - "pfq - pos %x: header %pK, msgid %x, header->msgid %x, header->size %x", 832 - pos, header, msgid, header->msgid, header->size); 834 + dev_err(state->dev, 835 + "core: pfq - pos %x: header %pK, msgid %x, header->msgid %x, header->size %x\n", 836 + pos, header, msgid, header->msgid, header->size); 833 837 WARN(1, "invalid slot position\n"); 834 838 } 835 839 } ··· 976 980 ((tx_end_index != quota->previous_tx_index) && 977 981 (quota->slot_use_count == quota->slot_quota))) { 978 982 spin_unlock(&quota_spinlock); 979 - vchiq_log_trace(state->dev, VCHIQ_CORE, 980 - "%d: qm:%d %s,%zx - quota stall (msg %d, slot %d)", 981 - state->id, service->localport, msg_type_str(type), size, 982 - quota->message_use_count, quota->slot_use_count); 983 + dev_dbg(state->dev, 984 + "core: %d: qm:%d %s,%zx - quota stall (msg %d, slot %d)\n", 985 + state->id, service->localport, msg_type_str(type), size, 986 + quota->message_use_count, quota->slot_use_count); 983 987 VCHIQ_SERVICE_STATS_INC(service, quota_stalls); 984 988 mutex_unlock(&state->slot_mutex); 985 989 if (wait_for_completion_interruptible(&quota->quota_event)) ··· 1019 1023 int tx_end_index; 1020 1024 int slot_use_count; 1021 1025 1022 - vchiq_log_debug(state->dev, VCHIQ_CORE, "%d: qm %s@%pK,%zx (%d->%d)", state->id, 1023 - msg_type_str(VCHIQ_MSG_TYPE(msgid)), header, size, 1024 - VCHIQ_MSG_SRCPORT(msgid), VCHIQ_MSG_DSTPORT(msgid)); 1026 + dev_dbg(state->dev, "core: %d: qm %s@%pK,%zx (%d->%d)\n", 1027 + state->id, msg_type_str(VCHIQ_MSG_TYPE(msgid)), header, size, 1028 + VCHIQ_MSG_SRCPORT(msgid), VCHIQ_MSG_DSTPORT(msgid)); 1025 1029 1026 1030 WARN_ON(flags & (QMFLAGS_NO_MUTEX_LOCK | 1027 1031 QMFLAGS_NO_MUTEX_UNLOCK)); ··· 1069 1073 spin_unlock(&quota_spinlock); 1070 1074 1071 1075 if (slot_use_count) 1072 - vchiq_log_trace(state->dev, VCHIQ_CORE, 1073 - "%d: qm:%d %s,%zx - slot_use->%d (hdr %p)", state->id, 1074 - service->localport, msg_type_str(VCHIQ_MSG_TYPE(msgid)), 1075 - size, slot_use_count, header); 1076 + dev_dbg(state->dev, "core: %d: qm:%d %s,%zx - slot_use->%d (hdr %p)\n", 1077 + state->id, service->localport, msg_type_str(VCHIQ_MSG_TYPE(msgid)), 1078 + size, slot_use_count, header); 1076 1079 1077 1080 VCHIQ_SERVICE_STATS_INC(service, ctrl_tx_count); 1078 1081 VCHIQ_SERVICE_STATS_ADD(service, ctrl_tx_bytes, size); 1079 1082 } else { 1080 - vchiq_log_debug(state->dev, VCHIQ_CORE, "%d: qm %s@%pK,%zx (%d->%d)", state->id, 1081 - msg_type_str(VCHIQ_MSG_TYPE(msgid)), header, size, 1082 - VCHIQ_MSG_SRCPORT(msgid), VCHIQ_MSG_DSTPORT(msgid)); 1083 + dev_dbg(state->dev, "core: %d: qm %s@%pK,%zx (%d->%d)\n", 1084 + state->id, msg_type_str(VCHIQ_MSG_TYPE(msgid)), header, size, 1085 + VCHIQ_MSG_SRCPORT(msgid), VCHIQ_MSG_DSTPORT(msgid)); 1083 1086 if (size != 0) { 1084 1087 /* 1085 1088 * It is assumed for now that this code path ··· 1106 1111 ? service->base.fourcc 1107 1112 : VCHIQ_MAKE_FOURCC('?', '?', '?', '?'); 1108 1113 1109 - vchiq_log_debug(state->dev, VCHIQ_CORE_MSG, 1110 - "Sent Msg %s(%u) to %p4cc s:%u d:%d len:%zu", 1111 - msg_type_str(VCHIQ_MSG_TYPE(msgid)), VCHIQ_MSG_TYPE(msgid), 1112 - &svc_fourcc, VCHIQ_MSG_SRCPORT(msgid), 1113 - VCHIQ_MSG_DSTPORT(msgid), size); 1114 + dev_dbg(state->dev, "core_msg: Sent Msg %s(%u) to %p4cc s:%u d:%d len:%zu\n", 1115 + msg_type_str(VCHIQ_MSG_TYPE(msgid)), VCHIQ_MSG_TYPE(msgid), 1116 + &svc_fourcc, VCHIQ_MSG_SRCPORT(msgid), VCHIQ_MSG_DSTPORT(msgid), size); 1114 1117 } 1115 1118 1116 1119 /* Make sure the new header is visible to the peer. */ ··· 1160 1167 int oldmsgid = header->msgid; 1161 1168 1162 1169 if (oldmsgid != VCHIQ_MSGID_PADDING) 1163 - vchiq_log_error(state->dev, VCHIQ_CORE, "%d: qms - msgid %x, not PADDING", 1164 - state->id, oldmsgid); 1170 + dev_err(state->dev, "core: %d: qms - msgid %x, not PADDING\n", 1171 + state->id, oldmsgid); 1165 1172 } 1166 1173 1167 - vchiq_log_debug(state->dev, VCHIQ_SYNC, 1168 - "%d: qms %s@%pK,%x (%d->%d)", state->id, 1169 - msg_type_str(VCHIQ_MSG_TYPE(msgid)), 1170 - header, size, VCHIQ_MSG_SRCPORT(msgid), 1171 - VCHIQ_MSG_DSTPORT(msgid)); 1174 + dev_dbg(state->dev, "sync: %d: qms %s@%pK,%x (%d->%d)\n", 1175 + state->id, msg_type_str(VCHIQ_MSG_TYPE(msgid)), header, size, 1176 + VCHIQ_MSG_SRCPORT(msgid), VCHIQ_MSG_DSTPORT(msgid)); 1172 1177 1173 1178 callback_result = 1174 1179 copy_message_data(copy_callback, context, ··· 1196 1205 svc_fourcc = service ? service->base.fourcc 1197 1206 : VCHIQ_MAKE_FOURCC('?', '?', '?', '?'); 1198 1207 1199 - vchiq_log_trace(state->dev, VCHIQ_SYNC, 1200 - "Sent Sync Msg %s(%u) to %p4cc s:%u d:%d len:%d", 1201 - msg_type_str(VCHIQ_MSG_TYPE(msgid)), VCHIQ_MSG_TYPE(msgid), 1202 - &svc_fourcc, VCHIQ_MSG_SRCPORT(msgid), 1203 - VCHIQ_MSG_DSTPORT(msgid), size); 1208 + dev_dbg(state->dev, 1209 + "sync: Sent Sync Msg %s(%u) to %p4cc s:%u d:%d len:%d\n", 1210 + msg_type_str(VCHIQ_MSG_TYPE(msgid)), VCHIQ_MSG_TYPE(msgid), 1211 + &svc_fourcc, VCHIQ_MSG_SRCPORT(msgid), 1212 + VCHIQ_MSG_DSTPORT(msgid), size); 1204 1213 1205 1214 remote_event_signal(&state->remote->sync_trigger); 1206 1215 ··· 1252 1261 VCHIQ_SLOT_QUEUE_MASK] = 1253 1262 SLOT_INDEX_FROM_INFO(state, slot_info); 1254 1263 state->remote->slot_queue_recycle = slot_queue_recycle + 1; 1255 - vchiq_log_debug(state->dev, VCHIQ_CORE, "%d: %s %d - recycle->%x", 1256 - state->id, __func__, SLOT_INDEX_FROM_INFO(state, slot_info), 1257 - state->remote->slot_queue_recycle); 1264 + dev_dbg(state->dev, "core: %d: %d - recycle->%x\n", 1265 + state->id, SLOT_INDEX_FROM_INFO(state, slot_info), 1266 + state->remote->slot_queue_recycle); 1258 1267 1259 1268 /* 1260 1269 * A write barrier is necessary, but remote_event_signal ··· 1289 1298 { 1290 1299 int status = 0; 1291 1300 1292 - vchiq_log_trace(service->state->dev, VCHIQ_CORE, 1293 - "%d: nb:%d %cx - p=%x rn=%x r=%x", 1294 - service->state->id, service->localport, 1295 - (queue == &service->bulk_tx) ? 't' : 'r', 1296 - queue->process, queue->remote_notify, queue->remove); 1301 + dev_dbg(service->state->dev, 1302 + "core: %d: nb:%d %cx - p=%x rn=%x r=%x\n", 1303 + service->state->id, service->localport, 1304 + (queue == &service->bulk_tx) ? 't' : 'r', 1305 + queue->process, queue->remote_notify, queue->remove); 1297 1306 1298 1307 queue->remote_notify = queue->process; 1299 1308 ··· 1373 1382 1374 1383 service_flags = atomic_xchg(&service->poll_flags, 0); 1375 1384 if (service_flags & BIT(VCHIQ_POLL_REMOVE)) { 1376 - vchiq_log_debug(state->dev, VCHIQ_CORE, "%d: ps - remove %d<->%d", 1377 - state->id, service->localport, service->remoteport); 1385 + dev_dbg(state->dev, "core: %d: ps - remove %d<->%d\n", 1386 + state->id, service->localport, service->remoteport); 1378 1387 1379 1388 /* 1380 1389 * Make it look like a client, because ··· 1386 1395 if (vchiq_close_service_internal(service, NO_CLOSE_RECVD)) 1387 1396 request_poll(state, service, VCHIQ_POLL_REMOVE); 1388 1397 } else if (service_flags & BIT(VCHIQ_POLL_TERMINATE)) { 1389 - vchiq_log_debug(state->dev, VCHIQ_CORE, "%d: ps - terminate %d<->%d", 1390 - state->id, service->localport, service->remoteport); 1398 + dev_dbg(state->dev, "core: %d: ps - terminate %d<->%d\n", 1399 + state->id, service->localport, service->remoteport); 1391 1400 if (vchiq_close_service_internal(service, NO_CLOSE_RECVD)) 1392 1401 request_poll(state, service, VCHIQ_POLL_TERMINATE); 1393 1402 } ··· 1416 1425 { 1417 1426 int is_tx = (queue == &service->bulk_tx); 1418 1427 1419 - vchiq_log_trace(service->state->dev, VCHIQ_CORE, 1420 - "%d: aob:%d %cx - li=%x ri=%x p=%x", 1421 - service->state->id, service->localport, 1422 - is_tx ? 't' : 'r', queue->local_insert, 1423 - queue->remote_insert, queue->process); 1428 + dev_dbg(service->state->dev, 1429 + "core: %d: aob:%d %cx - li=%x ri=%x p=%x\n", 1430 + service->state->id, service->localport, 1431 + is_tx ? 't' : 'r', queue->local_insert, 1432 + queue->remote_insert, queue->process); 1424 1433 1425 1434 WARN_ON((int)(queue->local_insert - queue->process) < 0); 1426 1435 WARN_ON((int)(queue->remote_insert - queue->process) < 0); ··· 1439 1448 if (queue->process != queue->local_insert) { 1440 1449 vchiq_complete_bulk(service->instance, bulk); 1441 1450 1442 - vchiq_log_debug(service->state->dev, VCHIQ_CORE_MSG, 1443 - "%s %p4cc d:%d ABORTED - tx len:%d, rx len:%d", 1444 - is_tx ? "Send Bulk to" : "Recv Bulk from", 1445 - &service->base.fourcc, 1446 - service->remoteport, bulk->size, bulk->remote_size); 1451 + dev_dbg(service->state->dev, 1452 + "core_msg: %s %p4cc d:%d ABORTED - tx len:%d, rx len:%d\n", 1453 + is_tx ? "Send Bulk to" : "Recv Bulk from", 1454 + &service->base.fourcc, 1455 + service->remoteport, bulk->size, bulk->remote_size); 1447 1456 } else { 1448 1457 /* fabricate a matching dummy bulk */ 1449 1458 bulk->data = 0; ··· 1476 1485 1477 1486 payload = (struct vchiq_open_payload *)header->data; 1478 1487 fourcc = payload->fourcc; 1479 - vchiq_log_debug(state->dev, VCHIQ_CORE, "%d: prs OPEN@%pK (%d->'%p4cc')", 1480 - state->id, header, localport, &fourcc); 1488 + dev_dbg(state->dev, "core: %d: prs OPEN@%pK (%d->'%p4cc')\n", 1489 + state->id, header, localport, &fourcc); 1481 1490 1482 1491 service = get_listening_service(state, fourcc); 1483 1492 if (!service) ··· 1600 1609 vchiq_service_put(service); 1601 1610 service = get_connected_service(state, remoteport); 1602 1611 if (service) 1603 - vchiq_log_warning(state->dev, VCHIQ_CORE, 1604 - "%d: prs %s@%pK (%d->%d) - found connected service %d", 1605 - state->id, msg_type_str(type), header, 1606 - remoteport, localport, service->localport); 1612 + dev_warn(state->dev, 1613 + "core: %d: prs %s@%pK (%d->%d) - found connected service %d\n", 1614 + state->id, msg_type_str(type), header, 1615 + remoteport, localport, service->localport); 1607 1616 } 1608 1617 1609 1618 if (!service) { 1610 - vchiq_log_error(state->dev, VCHIQ_CORE, 1611 - "%d: prs %s@%pK (%d->%d) - invalid/closed service %d", 1612 - state->id, msg_type_str(type), header, remoteport, 1613 - localport, localport); 1619 + dev_err(state->dev, 1620 + "core: %d: prs %s@%pK (%d->%d) - invalid/closed service %d\n", 1621 + state->id, msg_type_str(type), header, remoteport, 1622 + localport, localport); 1614 1623 goto skip_message; 1615 1624 } 1616 1625 break; ··· 1622 1631 svc_fourcc = service ? service->base.fourcc 1623 1632 : VCHIQ_MAKE_FOURCC('?', '?', '?', '?'); 1624 1633 1625 - vchiq_log_debug(state->dev, VCHIQ_CORE_MSG, 1626 - "Rcvd Msg %s(%u) from %p4cc s:%d d:%d len:%d", 1627 - msg_type_str(type), type, &svc_fourcc, 1628 - remoteport, localport, size); 1634 + dev_dbg(state->dev, "core_msg: Rcvd Msg %s(%u) from %p4cc s:%d d:%d len:%d\n", 1635 + msg_type_str(type), type, &svc_fourcc, remoteport, localport, size); 1629 1636 if (size > 0) 1630 1637 vchiq_log_dump_mem(state->dev, "Rcvd", 0, header->data, min(16, size)); 1631 1638 1632 1639 if (((unsigned long)header & VCHIQ_SLOT_MASK) + 1633 1640 calc_stride(size) > VCHIQ_SLOT_SIZE) { 1634 - vchiq_log_error(state->dev, VCHIQ_CORE, 1635 - "header %pK (msgid %x) - size %x too big for slot", 1636 - header, (unsigned int)msgid, (unsigned int)size); 1641 + dev_err(state->dev, "core: header %pK (msgid %x) - size %x too big for slot\n", 1642 + header, (unsigned int)msgid, (unsigned int)size); 1637 1643 WARN(1, "oversized for slot\n"); 1638 1644 } 1639 1645 ··· 1647 1659 header->data; 1648 1660 service->peer_version = payload->version; 1649 1661 } 1650 - vchiq_log_debug(state->dev, VCHIQ_CORE, 1651 - "%d: prs OPENACK@%pK,%x (%d->%d) v:%d", 1652 - state->id, header, size, remoteport, localport, 1653 - service->peer_version); 1662 + dev_dbg(state->dev, 1663 + "core: %d: prs OPENACK@%pK,%x (%d->%d) v:%d\n", 1664 + state->id, header, size, remoteport, localport, 1665 + service->peer_version); 1654 1666 if (service->srvstate == VCHIQ_SRVSTATE_OPENING) { 1655 1667 service->remoteport = remoteport; 1656 1668 set_service_state(service, VCHIQ_SRVSTATE_OPEN); 1657 1669 complete(&service->remove_event); 1658 1670 } else { 1659 - vchiq_log_error(state->dev, VCHIQ_CORE, "OPENACK received in state %s", 1660 - srvstate_names[service->srvstate]); 1671 + dev_err(state->dev, "core: OPENACK received in state %s\n", 1672 + srvstate_names[service->srvstate]); 1661 1673 } 1662 1674 break; 1663 1675 case VCHIQ_MSG_CLOSE: 1664 1676 WARN_ON(size); /* There should be no data */ 1665 1677 1666 - vchiq_log_debug(state->dev, VCHIQ_CORE, "%d: prs CLOSE@%pK (%d->%d)", 1667 - state->id, header, remoteport, localport); 1678 + dev_dbg(state->dev, "core: %d: prs CLOSE@%pK (%d->%d)\n", 1679 + state->id, header, remoteport, localport); 1668 1680 1669 1681 mark_service_closing_internal(service, 1); 1670 1682 1671 1683 if (vchiq_close_service_internal(service, CLOSE_RECVD) == -EAGAIN) 1672 1684 goto bail_not_ready; 1673 1685 1674 - vchiq_log_debug(state->dev, VCHIQ_CORE, "Close Service %p4cc s:%u d:%d", 1675 - &service->base.fourcc, 1676 - service->localport, service->remoteport); 1686 + dev_dbg(state->dev, "core: Close Service %p4cc s:%u d:%d\n", 1687 + &service->base.fourcc, service->localport, service->remoteport); 1677 1688 break; 1678 1689 case VCHIQ_MSG_DATA: 1679 - vchiq_log_debug(state->dev, VCHIQ_CORE, "%d: prs DATA@%pK,%x (%d->%d)", 1680 - state->id, header, size, remoteport, localport); 1690 + dev_dbg(state->dev, "core: %d: prs DATA@%pK,%x (%d->%d)\n", 1691 + state->id, header, size, remoteport, localport); 1681 1692 1682 1693 if ((service->remoteport == remoteport) && 1683 1694 (service->srvstate == VCHIQ_SRVSTATE_OPEN)) { ··· 1695 1708 } 1696 1709 break; 1697 1710 case VCHIQ_MSG_CONNECT: 1698 - vchiq_log_debug(state->dev, VCHIQ_CORE, "%d: prs CONNECT@%pK", 1699 - state->id, header); 1711 + dev_dbg(state->dev, "core: %d: prs CONNECT@%pK\n", 1712 + state->id, header); 1700 1713 state->version_common = ((struct vchiq_slot_zero *) 1701 1714 state->slot_data)->version; 1702 1715 complete(&state->connect); ··· 1727 1740 } 1728 1741 if ((int)(queue->remote_insert - 1729 1742 queue->local_insert) >= 0) { 1730 - vchiq_log_error(state->dev, VCHIQ_CORE, 1731 - "%d: prs %s@%pK (%d->%d) unexpected (ri=%d,li=%d)", 1732 - state->id, msg_type_str(type), header, remoteport, 1733 - localport, queue->remote_insert, 1734 - queue->local_insert); 1743 + dev_err(state->dev, 1744 + "core: %d: prs %s@%pK (%d->%d) unexpected (ri=%d,li=%d)\n", 1745 + state->id, msg_type_str(type), header, remoteport, 1746 + localport, queue->remote_insert, queue->local_insert); 1735 1747 mutex_unlock(&service->bulk_mutex); 1736 1748 break; 1737 1749 } ··· 1747 1761 bulk->actual = *(int *)header->data; 1748 1762 queue->remote_insert++; 1749 1763 1750 - vchiq_log_debug(state->dev, VCHIQ_CORE, 1751 - "%d: prs %s@%pK (%d->%d) %x@%pad", 1752 - state->id, msg_type_str(type), header, remoteport, 1753 - localport, bulk->actual, &bulk->data); 1764 + dev_dbg(state->dev, "core: %d: prs %s@%pK (%d->%d) %x@%pad\n", 1765 + state->id, msg_type_str(type), header, remoteport, 1766 + localport, bulk->actual, &bulk->data); 1754 1767 1755 - vchiq_log_trace(state->dev, VCHIQ_CORE, "%d: prs:%d %cx li=%x ri=%x p=%x", 1756 - state->id, localport, 1757 - (type == VCHIQ_MSG_BULK_RX_DONE) ? 'r' : 't', 1758 - queue->local_insert, queue->remote_insert, queue->process); 1768 + dev_dbg(state->dev, "core: %d: prs:%d %cx li=%x ri=%x p=%x\n", 1769 + state->id, localport, 1770 + (type == VCHIQ_MSG_BULK_RX_DONE) ? 'r' : 't', 1771 + queue->local_insert, queue->remote_insert, queue->process); 1759 1772 1760 1773 DEBUG_TRACE(PARSE_LINE); 1761 1774 WARN_ON(queue->process == queue->local_insert); ··· 1767 1782 } 1768 1783 break; 1769 1784 case VCHIQ_MSG_PADDING: 1770 - vchiq_log_trace(state->dev, VCHIQ_CORE, "%d: prs PADDING@%pK,%x", 1771 - state->id, header, size); 1785 + dev_dbg(state->dev, "core: %d: prs PADDING@%pK,%x\n", 1786 + state->id, header, size); 1772 1787 break; 1773 1788 case VCHIQ_MSG_PAUSE: 1774 1789 /* If initiated, signal the application thread */ 1775 - vchiq_log_trace(state->dev, VCHIQ_CORE, "%d: prs PAUSE@%pK,%x", 1776 - state->id, header, size); 1790 + dev_dbg(state->dev, "core: %d: prs PAUSE@%pK,%x\n", 1791 + state->id, header, size); 1777 1792 if (state->conn_state == VCHIQ_CONNSTATE_PAUSED) { 1778 - vchiq_log_error(state->dev, VCHIQ_CORE, 1779 - "%d: PAUSE received in state PAUSED", state->id); 1793 + dev_err(state->dev, "core: %d: PAUSE received in state PAUSED\n", 1794 + state->id); 1780 1795 break; 1781 1796 } 1782 1797 if (state->conn_state != VCHIQ_CONNSTATE_PAUSE_SENT) { ··· 1789 1804 vchiq_set_conn_state(state, VCHIQ_CONNSTATE_PAUSED); 1790 1805 break; 1791 1806 case VCHIQ_MSG_RESUME: 1792 - vchiq_log_trace(state->dev, VCHIQ_CORE, "%d: prs RESUME@%pK,%x", 1793 - state->id, header, size); 1807 + dev_dbg(state->dev, "core: %d: prs RESUME@%pK,%x\n", 1808 + state->id, header, size); 1794 1809 /* Release the slot mutex */ 1795 1810 mutex_unlock(&state->slot_mutex); 1796 1811 vchiq_set_conn_state(state, VCHIQ_CONNSTATE_CONNECTED); ··· 1806 1821 break; 1807 1822 1808 1823 default: 1809 - vchiq_log_error(state->dev, VCHIQ_CORE, "%d: prs invalid msgid %x@%pK,%x", 1810 - state->id, msgid, header, size); 1824 + dev_err(state->dev, "core: %d: prs invalid msgid %x@%pK,%x\n", 1825 + state->id, msgid, header, size); 1811 1826 WARN(1, "invalid message\n"); 1812 1827 break; 1813 1828 } ··· 1917 1932 * since the PAUSE should have flushed 1918 1933 * through outstanding messages. 1919 1934 */ 1920 - vchiq_log_error(state->dev, VCHIQ_CORE, "Failed to send RESUME message"); 1935 + dev_err(state->dev, "core: Failed to send RESUME message\n"); 1921 1936 } 1922 1937 break; 1923 1938 default: ··· 2017 2032 service = find_service_by_port(state, localport); 2018 2033 2019 2034 if (!service) { 2020 - vchiq_log_error(state->dev, VCHIQ_SYNC, 2021 - "%d: sf %s@%pK (%d->%d) - invalid/closed service %d", 2022 - state->id, msg_type_str(type), header, 2023 - remoteport, localport, localport); 2035 + dev_err(state->dev, 2036 + "sync: %d: sf %s@%pK (%d->%d) - invalid/closed service %d\n", 2037 + state->id, msg_type_str(type), header, remoteport, 2038 + localport, localport); 2024 2039 release_message_sync(state, header); 2025 2040 continue; 2026 2041 } 2027 2042 2028 - svc_fourcc = service ? service->base.fourcc 2029 - : VCHIQ_MAKE_FOURCC('?', '?', '?', '?'); 2043 + svc_fourcc = service->base.fourcc; 2030 2044 2031 - vchiq_log_trace(state->dev, VCHIQ_SYNC, 2032 - "Rcvd Msg %s from %p4cc s:%d d:%d len:%d", 2033 - msg_type_str(type), &svc_fourcc, 2034 - remoteport, localport, size); 2045 + dev_dbg(state->dev, "sync: Rcvd Msg %s from %p4cc s:%d d:%d len:%d\n", 2046 + msg_type_str(type), &svc_fourcc, remoteport, localport, size); 2035 2047 if (size > 0) 2036 2048 vchiq_log_dump_mem(state->dev, "Rcvd", 0, header->data, min(16, size)); 2037 2049 ··· 2040 2058 header->data; 2041 2059 service->peer_version = payload->version; 2042 2060 } 2043 - vchiq_log_debug(state->dev, VCHIQ_SYNC, "%d: sf OPENACK@%pK,%x (%d->%d) v:%d", 2044 - state->id, header, size, remoteport, localport, 2045 - service->peer_version); 2061 + dev_err(state->dev, "sync: %d: sf OPENACK@%pK,%x (%d->%d) v:%d\n", 2062 + state->id, header, size, remoteport, localport, 2063 + service->peer_version); 2046 2064 if (service->srvstate == VCHIQ_SRVSTATE_OPENING) { 2047 2065 service->remoteport = remoteport; 2048 2066 set_service_state(service, VCHIQ_SRVSTATE_OPENSYNC); ··· 2053 2071 break; 2054 2072 2055 2073 case VCHIQ_MSG_DATA: 2056 - vchiq_log_trace(state->dev, VCHIQ_SYNC, "%d: sf DATA@%pK,%x (%d->%d)", 2057 - state->id, header, size, remoteport, localport); 2074 + dev_dbg(state->dev, "sync: %d: sf DATA@%pK,%x (%d->%d)\n", 2075 + state->id, header, size, remoteport, localport); 2058 2076 2059 2077 if ((service->remoteport == remoteport) && 2060 2078 (service->srvstate == VCHIQ_SRVSTATE_OPENSYNC)) { 2061 2079 if (make_service_callback(service, VCHIQ_MESSAGE_AVAILABLE, header, 2062 2080 NULL) == -EAGAIN) 2063 - vchiq_log_error(state->dev, VCHIQ_SYNC, 2064 - "synchronous callback to service %d returns -EAGAIN", 2065 - localport); 2081 + dev_err(state->dev, 2082 + "sync: error: synchronous callback to service %d returns -EAGAIN\n", 2083 + localport); 2066 2084 } 2067 2085 break; 2068 2086 2069 2087 default: 2070 - vchiq_log_error(state->dev, VCHIQ_SYNC, "%d: sf unexpected msgid %x@%pK,%x", 2071 - state->id, msgid, header, size); 2088 + dev_err(state->dev, "sync: error: %d: sf unexpected msgid %x@%pK,%x\n", 2089 + state->id, msgid, header, size); 2072 2090 release_message_sync(state, header); 2073 2091 break; 2074 2092 } ··· 2101 2119 num_slots -= first_data_slot; 2102 2120 2103 2121 if (num_slots < 4) { 2104 - vchiq_log_error(dev, VCHIQ_CORE, "%s - insufficient memory %x bytes", 2105 - __func__, mem_size); 2122 + dev_err(dev, "core: %s: Insufficient memory %x bytes\n", 2123 + __func__, mem_size); 2106 2124 return NULL; 2107 2125 } 2108 2126 ··· 2444 2462 /* Bring this service online */ 2445 2463 set_service_state(service, srvstate); 2446 2464 2447 - vchiq_log_debug(state->dev, VCHIQ_CORE_MSG, "%s Service %p4cc SrcPort:%d", 2448 - (srvstate == VCHIQ_SRVSTATE_OPENING) ? "Open" : "Add", 2449 - &params->fourcc, service->localport); 2465 + dev_dbg(state->dev, "core_msg: %s Service %p4cc SrcPort:%d\n", 2466 + (srvstate == VCHIQ_SRVSTATE_OPENING) ? "Open" : "Add", 2467 + &params->fourcc, service->localport); 2450 2468 2451 2469 /* Don't unlock the service - leave it with a ref_count of 1. */ 2452 2470 ··· 2483 2501 } else if ((service->srvstate != VCHIQ_SRVSTATE_OPEN) && 2484 2502 (service->srvstate != VCHIQ_SRVSTATE_OPENSYNC)) { 2485 2503 if (service->srvstate != VCHIQ_SRVSTATE_CLOSEWAIT) 2486 - vchiq_log_error(service->state->dev, VCHIQ_CORE, 2487 - "%d: osi - srvstate = %s (ref %u)", 2488 - service->state->id, 2489 - srvstate_names[service->srvstate], 2490 - kref_read(&service->ref_count)); 2504 + dev_err(service->state->dev, 2505 + "core: %d: osi - srvstate = %s (ref %u)\n", 2506 + service->state->id, srvstate_names[service->srvstate], 2507 + kref_read(&service->ref_count)); 2491 2508 status = -EINVAL; 2492 2509 VCHIQ_SERVICE_STATS_INC(service, error_count); 2493 2510 vchiq_release_service_internal(service); ··· 2541 2560 int port = VCHIQ_MSG_DSTPORT(msgid); 2542 2561 2543 2562 if ((port == service->localport) && (msgid & VCHIQ_MSGID_CLAIMED)) { 2544 - vchiq_log_debug(state->dev, VCHIQ_CORE, 2545 - " fsi - hdr %pK", header); 2563 + dev_dbg(state->dev, "core: fsi - hdr %pK\n", header); 2546 2564 release_slot(state, slot_info, header, NULL); 2547 2565 } 2548 2566 pos += calc_stride(header->size); 2549 2567 if (pos > VCHIQ_SLOT_SIZE) { 2550 - vchiq_log_error(state->dev, VCHIQ_CORE, 2551 - "fsi - pos %x: header %pK, msgid %x, header->msgid %x, header->size %x", 2552 - pos, header, msgid, header->msgid, header->size); 2568 + dev_err(state->dev, 2569 + "core: fsi - pos %x: header %pK, msgid %x, header->msgid %x, header->size %x\n", 2570 + pos, header, msgid, header->msgid, header->size); 2553 2571 WARN(1, "invalid slot position\n"); 2554 2572 } 2555 2573 } ··· 2602 2622 case VCHIQ_SRVSTATE_LISTENING: 2603 2623 break; 2604 2624 default: 2605 - vchiq_log_error(service->state->dev, VCHIQ_CORE, "%s(%x) called in state %s", 2606 - __func__, service->handle, srvstate_names[service->srvstate]); 2625 + dev_err(service->state->dev, "core: (%x) called in state %s\n", 2626 + service->handle, srvstate_names[service->srvstate]); 2607 2627 WARN(1, "%s in unexpected state\n", __func__); 2608 2628 return -EINVAL; 2609 2629 } ··· 2649 2669 int close_id = MAKE_CLOSE(service->localport, 2650 2670 VCHIQ_MSG_DSTPORT(service->remoteport)); 2651 2671 2652 - vchiq_log_debug(state->dev, VCHIQ_CORE, "%d: csi:%d,%d (%s)", service->state->id, 2653 - service->localport, close_recvd, srvstate_names[service->srvstate]); 2672 + dev_dbg(state->dev, "core: %d: csi:%d,%d (%s)\n", 2673 + service->state->id, service->localport, close_recvd, 2674 + srvstate_names[service->srvstate]); 2654 2675 2655 2676 switch (service->srvstate) { 2656 2677 case VCHIQ_SRVSTATE_CLOSED: ··· 2659 2678 case VCHIQ_SRVSTATE_LISTENING: 2660 2679 case VCHIQ_SRVSTATE_CLOSEWAIT: 2661 2680 if (close_recvd) { 2662 - vchiq_log_error(state->dev, VCHIQ_CORE, "%s(1) called in state %s", 2663 - __func__, srvstate_names[service->srvstate]); 2681 + dev_err(state->dev, "core: (1) called in state %s\n", 2682 + srvstate_names[service->srvstate]); 2664 2683 } else if (is_server) { 2665 2684 if (service->srvstate == VCHIQ_SRVSTATE_LISTENING) { 2666 2685 status = -EINVAL; ··· 2747 2766 break; 2748 2767 2749 2768 default: 2750 - vchiq_log_error(state->dev, VCHIQ_CORE, "%s(%d) called in state %s", __func__, 2751 - close_recvd, srvstate_names[service->srvstate]); 2769 + dev_err(state->dev, "core: (%d) called in state %s\n", 2770 + close_recvd, srvstate_names[service->srvstate]); 2752 2771 break; 2753 2772 } 2754 2773 ··· 2761 2780 { 2762 2781 struct vchiq_state *state = service->state; 2763 2782 2764 - vchiq_log_debug(state->dev, VCHIQ_CORE, "%d: tsi - (%d<->%d)", state->id, 2765 - service->localport, service->remoteport); 2783 + dev_dbg(state->dev, "core: %d: tsi - (%d<->%d)\n", 2784 + state->id, service->localport, service->remoteport); 2766 2785 2767 2786 mark_service_closing(service); 2768 2787 ··· 2776 2795 { 2777 2796 struct vchiq_state *state = service->state; 2778 2797 2779 - vchiq_log_debug(state->dev, VCHIQ_CORE, "%d: fsi - (%d)", 2780 - state->id, service->localport); 2798 + dev_dbg(state->dev, "core: %d: fsi - (%d)\n", state->id, service->localport); 2781 2799 2782 2800 switch (service->srvstate) { 2783 2801 case VCHIQ_SRVSTATE_OPENING: ··· 2786 2806 case VCHIQ_SRVSTATE_CLOSEWAIT: 2787 2807 break; 2788 2808 default: 2789 - vchiq_log_error(state->dev, VCHIQ_CORE, "%d: fsi - (%d) in state %s", state->id, 2790 - service->localport, srvstate_names[service->srvstate]); 2809 + dev_err(state->dev, "core: %d: fsi - (%d) in state %s\n", 2810 + state->id, service->localport, srvstate_names[service->srvstate]); 2791 2811 return; 2792 2812 } 2793 2813 ··· 2856 2876 if (!service) 2857 2877 return -EINVAL; 2858 2878 2859 - vchiq_log_debug(service->state->dev, VCHIQ_CORE, "%d: close_service:%d", 2860 - service->state->id, service->localport); 2879 + dev_dbg(service->state->dev, "core: %d: close_service:%d\n", 2880 + service->state->id, service->localport); 2861 2881 2862 2882 if ((service->srvstate == VCHIQ_SRVSTATE_FREE) || 2863 2883 (service->srvstate == VCHIQ_SRVSTATE_LISTENING) || ··· 2887 2907 (service->srvstate == VCHIQ_SRVSTATE_OPEN)) 2888 2908 break; 2889 2909 2890 - vchiq_log_warning(service->state->dev, VCHIQ_CORE, 2891 - "%d: close_service:%d - waiting in state %s", 2892 - service->state->id, service->localport, 2893 - srvstate_names[service->srvstate]); 2910 + dev_warn(service->state->dev, 2911 + "core: %d: close_service:%d - waiting in state %s\n", 2912 + service->state->id, service->localport, 2913 + srvstate_names[service->srvstate]); 2894 2914 } 2895 2915 2896 2916 if (!status && ··· 2914 2934 if (!service) 2915 2935 return -EINVAL; 2916 2936 2917 - vchiq_log_debug(service->state->dev, VCHIQ_CORE, "%d: remove_service:%d", 2918 - service->state->id, service->localport); 2937 + dev_dbg(service->state->dev, "core: %d: remove_service:%d\n", 2938 + service->state->id, service->localport); 2919 2939 2920 2940 if (service->srvstate == VCHIQ_SRVSTATE_FREE) { 2921 2941 vchiq_service_put(service); ··· 2948 2968 (service->srvstate == VCHIQ_SRVSTATE_OPEN)) 2949 2969 break; 2950 2970 2951 - vchiq_log_warning(service->state->dev, VCHIQ_CORE, 2952 - "%d: remove_service:%d - waiting in state %s", 2953 - service->state->id, service->localport, 2954 - srvstate_names[service->srvstate]); 2971 + dev_warn(service->state->dev, 2972 + "core: %d: remove_service:%d - waiting in state %s\n", 2973 + service->state->id, service->localport, 2974 + srvstate_names[service->srvstate]); 2955 2975 } 2956 2976 2957 2977 if (!status && (service->srvstate != VCHIQ_SRVSTATE_FREE)) ··· 3058 3078 */ 3059 3079 wmb(); 3060 3080 3061 - vchiq_log_debug(state->dev, VCHIQ_CORE, "%d: bt (%d->%d) %cx %x@%pad %pK", 3062 - state->id, service->localport, service->remoteport, 3063 - dir_char, size, &bulk->data, userdata); 3081 + dev_dbg(state->dev, "core: %d: bt (%d->%d) %cx %x@%pad %pK\n", 3082 + state->id, service->localport, service->remoteport, 3083 + dir_char, size, &bulk->data, userdata); 3064 3084 3065 3085 /* 3066 3086 * The slot mutex must be held when the service is being closed, so ··· 3095 3115 mutex_unlock(&state->slot_mutex); 3096 3116 mutex_unlock(&service->bulk_mutex); 3097 3117 3098 - vchiq_log_trace(state->dev, VCHIQ_CORE, "%d: bt:%d %cx li=%x ri=%x p=%x", 3099 - state->id, service->localport, dir_char, queue->local_insert, 3100 - queue->remote_insert, queue->process); 3118 + dev_dbg(state->dev, "core: %d: bt:%d %cx li=%x ri=%x p=%x\n", 3119 + state->id, service->localport, dir_char, queue->local_insert, 3120 + queue->remote_insert, queue->process); 3101 3121 3102 3122 waiting: 3103 3123 vchiq_service_put(service); ··· 3352 3372 return ret; 3353 3373 } 3354 3374 3355 - static int 3356 - vchiq_dump_shared_state(void *dump_context, struct vchiq_state *state, 3375 + static void 3376 + vchiq_dump_shared_state(struct seq_file *f, struct vchiq_state *state, 3357 3377 struct vchiq_shared_state *shared, const char *label) 3358 3378 { 3359 3379 static const char *const debug_names[] = { ··· 3370 3390 "COMPLETION_QUEUE_FULL_COUNT" 3371 3391 }; 3372 3392 int i; 3373 - char buf[80]; 3374 - int len; 3375 - int err; 3376 3393 3377 - len = scnprintf(buf, sizeof(buf), " %s: slots %d-%d tx_pos=%x recycle=%x", 3378 - label, shared->slot_first, shared->slot_last, 3379 - shared->tx_pos, shared->slot_queue_recycle); 3380 - err = vchiq_dump(dump_context, buf, len + 1); 3381 - if (err) 3382 - return err; 3394 + seq_printf(f, " %s: slots %d-%d tx_pos=%x recycle=%x\n", 3395 + label, shared->slot_first, shared->slot_last, 3396 + shared->tx_pos, shared->slot_queue_recycle); 3383 3397 3384 - len = scnprintf(buf, sizeof(buf), " Slots claimed:"); 3385 - err = vchiq_dump(dump_context, buf, len + 1); 3386 - if (err) 3387 - return err; 3398 + seq_puts(f, " Slots claimed:\n"); 3388 3399 3389 3400 for (i = shared->slot_first; i <= shared->slot_last; i++) { 3390 3401 struct vchiq_slot_info slot_info = 3391 3402 *SLOT_INFO_FROM_INDEX(state, i); 3392 3403 if (slot_info.use_count != slot_info.release_count) { 3393 - len = scnprintf(buf, sizeof(buf), " %d: %d/%d", i, slot_info.use_count, 3394 - slot_info.release_count); 3395 - err = vchiq_dump(dump_context, buf, len + 1); 3396 - if (err) 3397 - return err; 3404 + seq_printf(f, " %d: %d/%d\n", i, slot_info.use_count, 3405 + slot_info.release_count); 3398 3406 } 3399 3407 } 3400 3408 3401 3409 for (i = 1; i < shared->debug[DEBUG_ENTRIES]; i++) { 3402 - len = scnprintf(buf, sizeof(buf), " DEBUG: %s = %d(%x)", 3403 - debug_names[i], shared->debug[i], shared->debug[i]); 3404 - err = vchiq_dump(dump_context, buf, len + 1); 3405 - if (err) 3406 - return err; 3410 + seq_printf(f, " DEBUG: %s = %d(%x)\n", 3411 + debug_names[i], shared->debug[i], shared->debug[i]); 3407 3412 } 3408 - return 0; 3409 3413 } 3410 3414 3411 - int vchiq_dump_state(void *dump_context, struct vchiq_state *state) 3415 + static void 3416 + vchiq_dump_service_state(struct seq_file *f, struct vchiq_service *service) 3412 3417 { 3413 - char buf[80]; 3414 - int len; 3415 - int i; 3416 - int err; 3417 - 3418 - len = scnprintf(buf, sizeof(buf), "State %d: %s", state->id, 3419 - conn_state_names[state->conn_state]); 3420 - err = vchiq_dump(dump_context, buf, len + 1); 3421 - if (err) 3422 - return err; 3423 - 3424 - len = scnprintf(buf, sizeof(buf), " tx_pos=%x(@%pK), rx_pos=%x(@%pK)", 3425 - state->local->tx_pos, 3426 - state->tx_data + (state->local_tx_pos & VCHIQ_SLOT_MASK), 3427 - state->rx_pos, 3428 - state->rx_data + (state->rx_pos & VCHIQ_SLOT_MASK)); 3429 - err = vchiq_dump(dump_context, buf, len + 1); 3430 - if (err) 3431 - return err; 3432 - 3433 - len = scnprintf(buf, sizeof(buf), " Version: %d (min %d)", 3434 - VCHIQ_VERSION, VCHIQ_VERSION_MIN); 3435 - err = vchiq_dump(dump_context, buf, len + 1); 3436 - if (err) 3437 - return err; 3438 - 3439 - if (VCHIQ_ENABLE_STATS) { 3440 - len = scnprintf(buf, sizeof(buf), 3441 - " Stats: ctrl_tx_count=%d, ctrl_rx_count=%d, error_count=%d", 3442 - state->stats.ctrl_tx_count, state->stats.ctrl_rx_count, 3443 - state->stats.error_count); 3444 - err = vchiq_dump(dump_context, buf, len + 1); 3445 - if (err) 3446 - return err; 3447 - } 3448 - 3449 - len = scnprintf(buf, sizeof(buf), 3450 - " Slots: %d available (%d data), %d recyclable, %d stalls (%d data)", 3451 - ((state->slot_queue_available * VCHIQ_SLOT_SIZE) - 3452 - state->local_tx_pos) / VCHIQ_SLOT_SIZE, 3453 - state->data_quota - state->data_use_count, 3454 - state->local->slot_queue_recycle - state->slot_queue_available, 3455 - state->stats.slot_stalls, state->stats.data_stalls); 3456 - err = vchiq_dump(dump_context, buf, len + 1); 3457 - if (err) 3458 - return err; 3459 - 3460 - err = vchiq_dump_platform_state(dump_context); 3461 - if (err) 3462 - return err; 3463 - 3464 - err = vchiq_dump_shared_state(dump_context, 3465 - state, 3466 - state->local, 3467 - "Local"); 3468 - if (err) 3469 - return err; 3470 - err = vchiq_dump_shared_state(dump_context, 3471 - state, 3472 - state->remote, 3473 - "Remote"); 3474 - if (err) 3475 - return err; 3476 - 3477 - err = vchiq_dump_platform_instances(dump_context); 3478 - if (err) 3479 - return err; 3480 - 3481 - for (i = 0; i < state->unused_service; i++) { 3482 - struct vchiq_service *service = find_service_by_port(state, i); 3483 - 3484 - if (service) { 3485 - err = vchiq_dump_service_state(dump_context, service); 3486 - vchiq_service_put(service); 3487 - if (err) 3488 - return err; 3489 - } 3490 - } 3491 - return 0; 3492 - } 3493 - 3494 - int vchiq_dump_service_state(void *dump_context, struct vchiq_service *service) 3495 - { 3496 - char buf[80]; 3497 - int len; 3498 - int err; 3499 3418 unsigned int ref_count; 3500 3419 3501 3420 /*Don't include the lock just taken*/ 3502 3421 ref_count = kref_read(&service->ref_count) - 1; 3503 - len = scnprintf(buf, sizeof(buf), "Service %u: %s (ref %u)", 3504 - service->localport, srvstate_names[service->srvstate], 3505 - ref_count); 3422 + seq_printf(f, "Service %u: %s (ref %u)", service->localport, 3423 + srvstate_names[service->srvstate], ref_count); 3506 3424 3507 3425 if (service->srvstate != VCHIQ_SRVSTATE_FREE) { 3508 3426 char remoteport[30]; 3509 3427 struct vchiq_service_quota *quota = 3510 3428 &service->state->service_quotas[service->localport]; 3511 3429 int fourcc = service->base.fourcc; 3512 - int tx_pending, rx_pending; 3430 + int tx_pending, rx_pending, tx_size = 0, rx_size = 0; 3513 3431 3514 3432 if (service->remoteport != VCHIQ_PORT_FREE) { 3515 3433 int len2 = scnprintf(remoteport, sizeof(remoteport), ··· 3420 3542 strscpy(remoteport, "n/a", sizeof(remoteport)); 3421 3543 } 3422 3544 3423 - len += scnprintf(buf + len, sizeof(buf) - len, 3424 - " '%p4cc' remote %s (msg use %d/%d, slot use %d/%d)", 3425 - &fourcc, remoteport, 3426 - quota->message_use_count, quota->message_quota, 3427 - quota->slot_use_count, quota->slot_quota); 3428 - 3429 - err = vchiq_dump(dump_context, buf, len + 1); 3430 - if (err) 3431 - return err; 3545 + seq_printf(f, " '%p4cc' remote %s (msg use %d/%d, slot use %d/%d)\n", 3546 + &fourcc, remoteport, 3547 + quota->message_use_count, quota->message_quota, 3548 + quota->slot_use_count, quota->slot_quota); 3432 3549 3433 3550 tx_pending = service->bulk_tx.local_insert - 3434 3551 service->bulk_tx.remote_insert; 3552 + if (tx_pending) { 3553 + unsigned int i = BULK_INDEX(service->bulk_tx.remove); 3554 + 3555 + tx_size = service->bulk_tx.bulks[i].size; 3556 + } 3435 3557 3436 3558 rx_pending = service->bulk_rx.local_insert - 3437 3559 service->bulk_rx.remote_insert; 3560 + if (rx_pending) { 3561 + unsigned int i = BULK_INDEX(service->bulk_rx.remove); 3438 3562 3439 - len = scnprintf(buf, sizeof(buf), 3440 - " Bulk: tx_pending=%d (size %d), rx_pending=%d (size %d)", 3441 - tx_pending, 3442 - tx_pending ? 3443 - service->bulk_tx.bulks[BULK_INDEX(service->bulk_tx.remove)].size : 3444 - 0, rx_pending, rx_pending ? 3445 - service->bulk_rx.bulks[BULK_INDEX(service->bulk_rx.remove)].size : 3446 - 0); 3563 + rx_size = service->bulk_rx.bulks[i].size; 3564 + } 3565 + 3566 + seq_printf(f, " Bulk: tx_pending=%d (size %d), rx_pending=%d (size %d)\n", 3567 + tx_pending, tx_size, rx_pending, rx_size); 3447 3568 3448 3569 if (VCHIQ_ENABLE_STATS) { 3449 - err = vchiq_dump(dump_context, buf, len + 1); 3450 - if (err) 3451 - return err; 3570 + seq_printf(f, " Ctrl: tx_count=%d, tx_bytes=%llu, rx_count=%d, rx_bytes=%llu\n", 3571 + service->stats.ctrl_tx_count, 3572 + service->stats.ctrl_tx_bytes, 3573 + service->stats.ctrl_rx_count, 3574 + service->stats.ctrl_rx_bytes); 3452 3575 3453 - len = scnprintf(buf, sizeof(buf), 3454 - " Ctrl: tx_count=%d, tx_bytes=%llu, rx_count=%d, rx_bytes=%llu", 3455 - service->stats.ctrl_tx_count, service->stats.ctrl_tx_bytes, 3456 - service->stats.ctrl_rx_count, service->stats.ctrl_rx_bytes); 3457 - err = vchiq_dump(dump_context, buf, len + 1); 3458 - if (err) 3459 - return err; 3576 + seq_printf(f, " Bulk: tx_count=%d, tx_bytes=%llu, rx_count=%d, rx_bytes=%llu\n", 3577 + service->stats.bulk_tx_count, 3578 + service->stats.bulk_tx_bytes, 3579 + service->stats.bulk_rx_count, 3580 + service->stats.bulk_rx_bytes); 3460 3581 3461 - len = scnprintf(buf, sizeof(buf), 3462 - " Bulk: tx_count=%d, tx_bytes=%llu, rx_count=%d, rx_bytes=%llu", 3463 - service->stats.bulk_tx_count, service->stats.bulk_tx_bytes, 3464 - service->stats.bulk_rx_count, service->stats.bulk_rx_bytes); 3465 - err = vchiq_dump(dump_context, buf, len + 1); 3466 - if (err) 3467 - return err; 3468 - 3469 - len = scnprintf(buf, sizeof(buf), 3470 - " %d quota stalls, %d slot stalls, %d bulk stalls, %d aborted, %d errors", 3471 - service->stats.quota_stalls, service->stats.slot_stalls, 3472 - service->stats.bulk_stalls, 3473 - service->stats.bulk_aborted_count, 3474 - service->stats.error_count); 3582 + seq_printf(f, " %d quota stalls, %d slot stalls, %d bulk stalls, %d aborted, %d errors\n", 3583 + service->stats.quota_stalls, 3584 + service->stats.slot_stalls, 3585 + service->stats.bulk_stalls, 3586 + service->stats.bulk_aborted_count, 3587 + service->stats.error_count); 3475 3588 } 3476 3589 } 3477 3590 3478 - err = vchiq_dump(dump_context, buf, len + 1); 3479 - if (err) 3480 - return err; 3591 + vchiq_dump_platform_service_state(f, service); 3592 + } 3481 3593 3482 - if (service->srvstate != VCHIQ_SRVSTATE_FREE) 3483 - err = vchiq_dump_platform_service_state(dump_context, service); 3484 - return err; 3594 + void vchiq_dump_state(struct seq_file *f, struct vchiq_state *state) 3595 + { 3596 + int i; 3597 + 3598 + seq_printf(f, "State %d: %s\n", state->id, 3599 + conn_state_names[state->conn_state]); 3600 + 3601 + seq_printf(f, " tx_pos=%x(@%pK), rx_pos=%x(@%pK)\n", 3602 + state->local->tx_pos, 3603 + state->tx_data + (state->local_tx_pos & VCHIQ_SLOT_MASK), 3604 + state->rx_pos, 3605 + state->rx_data + (state->rx_pos & VCHIQ_SLOT_MASK)); 3606 + 3607 + seq_printf(f, " Version: %d (min %d)\n", VCHIQ_VERSION, 3608 + VCHIQ_VERSION_MIN); 3609 + 3610 + if (VCHIQ_ENABLE_STATS) { 3611 + seq_printf(f, " Stats: ctrl_tx_count=%d, ctrl_rx_count=%d, error_count=%d\n", 3612 + state->stats.ctrl_tx_count, state->stats.ctrl_rx_count, 3613 + state->stats.error_count); 3614 + } 3615 + 3616 + seq_printf(f, " Slots: %d available (%d data), %d recyclable, %d stalls (%d data)\n", 3617 + ((state->slot_queue_available * VCHIQ_SLOT_SIZE) - 3618 + state->local_tx_pos) / VCHIQ_SLOT_SIZE, 3619 + state->data_quota - state->data_use_count, 3620 + state->local->slot_queue_recycle - state->slot_queue_available, 3621 + state->stats.slot_stalls, state->stats.data_stalls); 3622 + 3623 + vchiq_dump_platform_state(f); 3624 + 3625 + vchiq_dump_shared_state(f, state, state->local, "Local"); 3626 + 3627 + vchiq_dump_shared_state(f, state, state->remote, "Remote"); 3628 + 3629 + vchiq_dump_platform_instances(f); 3630 + 3631 + for (i = 0; i < state->unused_service; i++) { 3632 + struct vchiq_service *service = find_service_by_port(state, i); 3633 + 3634 + if (service) { 3635 + vchiq_dump_service_state(f, service); 3636 + vchiq_service_put(service); 3637 + } 3638 + } 3485 3639 } 3486 3640 3487 3641 int vchiq_send_remote_use(struct vchiq_state *state) ··· 3563 3653 *s++ = '\0'; 3564 3654 3565 3655 if (label && (*label != '\0')) 3566 - vchiq_log_trace(dev, VCHIQ_CORE, "%s: %08x: %s", label, addr, line_buf); 3656 + dev_dbg(dev, "core: %s: %08x: %s\n", label, addr, line_buf); 3567 3657 else 3568 - vchiq_log_trace(dev, VCHIQ_CORE, "%s: %08x: %s", label, addr, line_buf); 3658 + dev_dbg(dev, "core: %s: %08x: %s\n", label, addr, line_buf); 3569 3659 3570 3660 addr += 16; 3571 3661 mem += 16;
+6 -48
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
··· 6 6 7 7 #include <linux/mutex.h> 8 8 #include <linux/completion.h> 9 + #include <linux/debugfs.h> 9 10 #include <linux/dev_printk.h> 10 11 #include <linux/kthread.h> 11 12 #include <linux/kref.h> ··· 31 30 32 31 #define VCHIQ_SLOT_SIZE 4096 33 32 #define VCHIQ_MAX_MSG_SIZE (VCHIQ_SLOT_SIZE - sizeof(struct vchiq_header)) 34 - 35 - enum vchiq_log_category { 36 - VCHIQ_ARM, 37 - VCHIQ_CORE, 38 - VCHIQ_CORE_MSG, 39 - VCHIQ_SYNC, 40 - VCHIQ_SUSPEND, 41 - }; 42 - 43 - static inline const char *log_category_str(enum vchiq_log_category c) 44 - { 45 - static const char * const strings[] = { 46 - "vchiq_arm", 47 - "vchiq_core", 48 - "vchiq_core_msg", 49 - "vchiq_sync", 50 - "vchiq_suspend", 51 - }; 52 - 53 - return strings[c]; 54 - }; 55 - 56 - #ifndef vchiq_log_error 57 - #define vchiq_log_error(dev, cat, fmt, ...) \ 58 - do { dev_dbg(dev, "%s error: " fmt, log_category_str(cat), ##__VA_ARGS__); } while (0) 59 - #endif 60 - #ifndef vchiq_log_warning 61 - #define vchiq_log_warning(dev, cat, fmt, ...) \ 62 - do { dev_dbg(dev, "%s warning: " fmt, log_category_str(cat), ##__VA_ARGS__); } while (0) 63 - #endif 64 - #ifndef vchiq_log_debug 65 - #define vchiq_log_debug(dev, cat, fmt, ...) \ 66 - do { dev_dbg(dev, "%s debug: " fmt, log_category_str(cat), ##__VA_ARGS__); } while (0) 67 - #endif 68 - #ifndef vchiq_log_trace 69 - #define vchiq_log_trace(dev, cat, fmt, ...) \ 70 - do { dev_dbg(dev, "%s trace: " fmt, log_category_str(cat), ##__VA_ARGS__); } while (0) 71 - #endif 72 33 73 34 #define VCHIQ_SLOT_MASK (VCHIQ_SLOT_SIZE - 1) 74 35 #define VCHIQ_SLOT_QUEUE_MASK (VCHIQ_MAX_SLOTS_PER_SIDE - 1) ··· 467 504 void __user *uoffset, int size, void *userdata, enum vchiq_bulk_mode mode, 468 505 enum vchiq_bulk_dir dir); 469 506 470 - extern int 471 - vchiq_dump_state(void *dump_context, struct vchiq_state *state); 472 - 473 - extern int 474 - vchiq_dump_service_state(void *dump_context, struct vchiq_service *service); 507 + extern void 508 + vchiq_dump_state(struct seq_file *f, struct vchiq_state *state); 475 509 476 510 extern void 477 511 vchiq_loud_error_header(void); ··· 524 564 525 565 void remote_event_signal(struct remote_event *event); 526 566 527 - int vchiq_dump(void *dump_context, const char *str, int len); 567 + void vchiq_dump_platform_state(struct seq_file *f); 528 568 529 - int vchiq_dump_platform_state(void *dump_context); 569 + void vchiq_dump_platform_instances(struct seq_file *f); 530 570 531 - int vchiq_dump_platform_instances(void *dump_context); 532 - 533 - int vchiq_dump_platform_service_state(void *dump_context, struct vchiq_service *service); 571 + void vchiq_dump_platform_service_state(struct seq_file *f, struct vchiq_service *service); 534 572 535 573 int vchiq_use_service_internal(struct vchiq_service *service); 536 574
+10
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c
··· 40 40 return 0; 41 41 } 42 42 43 + static int vchiq_dump_show(struct seq_file *f, void *offset) 44 + { 45 + vchiq_dump_state(f, &g_state); 46 + return 0; 47 + } 48 + DEFINE_SHOW_ATTRIBUTE(vchiq_dump); 49 + 43 50 static int debugfs_trace_open(struct inode *inode, struct file *file) 44 51 { 45 52 return single_open(file, debugfs_trace_show, inode->i_private); ··· 122 115 { 123 116 vchiq_dbg_dir = debugfs_create_dir("vchiq", NULL); 124 117 vchiq_dbg_clients = debugfs_create_dir("clients", vchiq_dbg_dir); 118 + 119 + debugfs_create_file("state", S_IFREG | 0444, vchiq_dbg_dir, NULL, 120 + &vchiq_dump_fops); 125 121 } 126 122 127 123 /* remove all the debugfs entries */
+43 -70
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c
··· 47 47 48 48 static void close_delivered(struct user_service *user_service) 49 49 { 50 - vchiq_log_debug(user_service->service->state->dev, VCHIQ_ARM, 51 - "%s(handle=%x)", 52 - __func__, user_service->service->handle); 50 + dev_dbg(user_service->service->state->dev, 51 + "arm: (handle=%x)\n", user_service->service->handle); 53 52 54 53 if (user_service->close_pending) { 55 54 /* Allow the underlying service to be culled */ ··· 234 235 spin_unlock(&msg_queue_spinlock); 235 236 DEBUG_TRACE(DEQUEUE_MESSAGE_LINE); 236 237 if (wait_for_completion_interruptible(&user_service->insert_event)) { 237 - vchiq_log_debug(service->state->dev, VCHIQ_ARM, 238 - "DEQUEUE_MESSAGE interrupted"); 238 + dev_dbg(service->state->dev, "arm: DEQUEUE_MESSAGE interrupted\n"); 239 239 ret = -EINTR; 240 240 break; 241 241 } ··· 269 271 ret = -EFAULT; 270 272 } 271 273 } else { 272 - vchiq_log_error(service->state->dev, VCHIQ_ARM, 273 - "header %pK: bufsize %x < size %x", 274 - header, args->bufsize, header->size); 274 + dev_err(service->state->dev, 275 + "arm: header %pK: bufsize %x < size %x\n", 276 + header, args->bufsize, header->size); 275 277 WARN(1, "invalid size\n"); 276 278 ret = -EMSGSIZE; 277 279 } ··· 316 318 } 317 319 mutex_unlock(&instance->bulk_waiter_list_mutex); 318 320 if (!waiter) { 319 - vchiq_log_error(service->state->dev, VCHIQ_ARM, 320 - "no bulk_waiter found for pid %d", current->pid); 321 + dev_err(service->state->dev, 322 + "arm: no bulk_waiter found for pid %d\n", current->pid); 321 323 ret = -ESRCH; 322 324 goto out; 323 325 } 324 - vchiq_log_debug(service->state->dev, VCHIQ_ARM, 325 - "found bulk_waiter %pK for pid %d", waiter, current->pid); 326 + dev_dbg(service->state->dev, "arm: found bulk_waiter %pK for pid %d\n", 327 + waiter, current->pid); 326 328 userdata = &waiter->bulk_waiter; 327 329 } else { 328 330 userdata = args->userdata; ··· 353 355 mutex_lock(&instance->bulk_waiter_list_mutex); 354 356 list_add(&waiter->list, &instance->bulk_waiter_list); 355 357 mutex_unlock(&instance->bulk_waiter_list_mutex); 356 - vchiq_log_debug(service->state->dev, VCHIQ_ARM, 357 - "saved bulk_waiter %pK for pid %d", waiter, current->pid); 358 + dev_dbg(service->state->dev, "arm: saved bulk_waiter %pK for pid %d\n", 359 + waiter, current->pid); 358 360 359 361 ret = put_user(mode_waiting, mode); 360 362 } ··· 453 455 mutex_lock(&instance->completion_mutex); 454 456 if (rc) { 455 457 DEBUG_TRACE(AWAIT_COMPLETION_LINE); 456 - vchiq_log_debug(instance->state->dev, VCHIQ_ARM, 457 - "AWAIT_COMPLETION interrupted"); 458 + dev_dbg(instance->state->dev, "arm: AWAIT_COMPLETION interrupted\n"); 458 459 ret = -EINTR; 459 460 goto out; 460 461 } ··· 498 501 msglen = header->size + sizeof(struct vchiq_header); 499 502 /* This must be a VCHIQ-style service */ 500 503 if (args->msgbufsize < msglen) { 501 - vchiq_log_error(service->state->dev, VCHIQ_ARM, 502 - "header %pK: msgbufsize %x < msglen %x", 503 - header, args->msgbufsize, msglen); 504 - WARN(1, "invalid message size\n"); 504 + dev_err(service->state->dev, 505 + "arm: header %pK: msgbufsize %x < msglen %x\n", 506 + header, args->msgbufsize, msglen); 507 + WARN(1, "invalid message size\n"); 505 508 if (ret == 0) 506 509 ret = -EMSGSIZE; 507 510 break; ··· 579 582 long ret = 0; 580 583 int i, rc; 581 584 582 - vchiq_log_trace(instance->state->dev, VCHIQ_ARM, 583 - "%s - instance %pK, cmd %s, arg %lx", __func__, instance, 584 - ((_IOC_TYPE(cmd) == VCHIQ_IOC_MAGIC) && (_IOC_NR(cmd) <= VCHIQ_IOC_MAX)) ? 585 - ioctl_names[_IOC_NR(cmd)] : "<invalid>", arg); 585 + dev_dbg(instance->state->dev, "arm: instance %pK, cmd %s, arg %lx\n", instance, 586 + ((_IOC_TYPE(cmd) == VCHIQ_IOC_MAGIC) && (_IOC_NR(cmd) <= VCHIQ_IOC_MAX)) ? 587 + ioctl_names[_IOC_NR(cmd)] : "<invalid>", arg); 586 588 587 589 switch (cmd) { 588 590 case VCHIQ_IOC_SHUTDOWN: ··· 614 618 } 615 619 rc = mutex_lock_killable(&instance->state->mutex); 616 620 if (rc) { 617 - vchiq_log_error(instance->state->dev, VCHIQ_ARM, 618 - "vchiq: connect: could not lock mutex for state %d: %d", 619 - instance->state->id, rc); 621 + dev_err(instance->state->dev, 622 + "arm: vchiq: connect: could not lock mutex for state %d: %d\n", 623 + instance->state->id, rc); 620 624 ret = -EINTR; 621 625 break; 622 626 } ··· 626 630 if (!status) 627 631 instance->connected = 1; 628 632 else 629 - vchiq_log_error(instance->state->dev, VCHIQ_ARM, 630 - "vchiq: could not connect: %d", status); 633 + dev_err(instance->state->dev, 634 + "arm: vchiq: could not connect: %d\n", status); 631 635 break; 632 636 633 637 case VCHIQ_IOC_CREATE_SERVICE: { ··· 696 700 vchiq_use_service_internal(service) : 697 701 vchiq_release_service_internal(service); 698 702 if (ret) { 699 - vchiq_log_error(instance->state->dev, VCHIQ_SUSPEND, 700 - "%s: cmd %s returned error %ld for service %p4cc:%03d", 701 - __func__, (cmd == VCHIQ_IOC_USE_SERVICE) ? 702 - "VCHIQ_IOC_USE_SERVICE" : 703 - "VCHIQ_IOC_RELEASE_SERVICE", 704 - ret, &service->base.fourcc, 705 - service->client_id); 703 + dev_err(instance->state->dev, 704 + "suspend: cmd %s returned error %ld for service %p4cc:%03d\n", 705 + (cmd == VCHIQ_IOC_USE_SERVICE) ? 706 + "VCHIQ_IOC_USE_SERVICE" : 707 + "VCHIQ_IOC_RELEASE_SERVICE", 708 + ret, &service->base.fourcc, 709 + service->client_id); 706 710 } 707 711 } else { 708 712 ret = -EINVAL; ··· 864 868 } 865 869 866 870 if (!status && (ret < 0) && (ret != -EINTR) && (ret != -EWOULDBLOCK)) { 867 - vchiq_log_debug(instance->state->dev, VCHIQ_ARM, 868 - " ioctl instance %pK, cmd %s -> status %d, %ld", 869 - instance, (_IOC_NR(cmd) <= VCHIQ_IOC_MAX) ? 870 - ioctl_names[_IOC_NR(cmd)] : "<invalid>", status, ret); 871 + dev_dbg(instance->state->dev, 872 + "arm: ioctl instance %pK, cmd %s -> status %d, %ld\n", 873 + instance, (_IOC_NR(cmd) <= VCHIQ_IOC_MAX) ? 874 + ioctl_names[_IOC_NR(cmd)] : "<invalid>", status, ret); 871 875 } else { 872 - vchiq_log_trace(instance->state->dev, VCHIQ_ARM, 873 - " ioctl instance %pK, cmd %s -> status %d, %ld", 874 - instance, (_IOC_NR(cmd) <= VCHIQ_IOC_MAX) ? 875 - ioctl_names[_IOC_NR(cmd)] : "<invalid>", status, ret); 876 + dev_dbg(instance->state->dev, 877 + "arm: ioctl instance %pK, cmd %s -> status %d\n, %ld\n", 878 + instance, (_IOC_NR(cmd) <= VCHIQ_IOC_MAX) ? 879 + ioctl_names[_IOC_NR(cmd)] : "<invalid>", status, ret); 876 880 } 877 881 878 882 return ret; ··· 1166 1170 struct vchiq_state *state = vchiq_get_state(); 1167 1171 struct vchiq_instance *instance; 1168 1172 1169 - vchiq_log_debug(state->dev, VCHIQ_ARM, "vchiq_open"); 1173 + dev_dbg(state->dev, "arm: vchiq open\n"); 1170 1174 1171 1175 if (!state) { 1172 - vchiq_log_error(state->dev, VCHIQ_ARM, 1173 - "vchiq has no connection to VideoCore"); 1176 + dev_err(state->dev, "arm: vchiq has no connection to VideoCore\n"); 1174 1177 return -ENOTCONN; 1175 1178 } 1176 1179 ··· 1201 1206 int ret = 0; 1202 1207 int i; 1203 1208 1204 - vchiq_log_debug(state->dev, VCHIQ_ARM, "%s: instance=%lx", __func__, 1205 - (unsigned long)instance); 1209 + dev_dbg(state->dev, "arm: instance=%p\n", instance); 1206 1210 1207 1211 if (!state) { 1208 1212 ret = -EPERM; ··· 1300 1306 return ret; 1301 1307 } 1302 1308 1303 - static ssize_t 1304 - vchiq_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) 1305 - { 1306 - struct dump_context context; 1307 - int err; 1308 - 1309 - context.buf = buf; 1310 - context.actual = 0; 1311 - context.space = count; 1312 - context.offset = *ppos; 1313 - 1314 - err = vchiq_dump_state(&context, &g_state); 1315 - if (err) 1316 - return err; 1317 - 1318 - *ppos += context.actual; 1319 - 1320 - return context.actual; 1321 - } 1322 - 1323 1309 static const struct file_operations 1324 1310 vchiq_fops = { 1325 1311 .owner = THIS_MODULE, ··· 1309 1335 #endif 1310 1336 .open = vchiq_open, 1311 1337 .release = vchiq_release, 1312 - .read = vchiq_read 1313 1338 }; 1314 1339 1315 1340 static struct miscdevice vchiq_miscdev = {
+18 -4
drivers/staging/vme_user/Kconfig
··· 3 3 bool "VME bridge support" 4 4 depends on PCI 5 5 help 6 - If you say Y here you get support for the VME bridge Framework. 6 + Enable support for VME (VersaModular Eurocard bus) bridge modules. 7 + The bridge allows connecting VME devices to systems with existing 8 + interfaces (like USB or PCI) by means of translating VME protocol 9 + operations. 10 + 11 + Note that this only enables the bridge framework. You'll also 12 + likely want to enable driver for specific bridge device you have 13 + to actually use it. If unsure, say N. 7 14 8 15 if VME_BUS 9 16 10 17 comment "VME Bridge Drivers" 11 18 12 19 config VME_TSI148 13 - tristate "Tempe" 20 + tristate "Tundra TSI148 VME bridge support" 14 21 depends on HAS_DMA 15 22 help 16 - If you say Y here you get support for the Tundra TSI148 VME bridge 17 - chip. 23 + If you say Y here you get support for the Tundra TSI148 VME-to-PCI/X 24 + bridge chip (and pin-compatible clones). 25 + 26 + TSI148 is a high-performant, 2eSST and VME64-compliant VME-to-PCI/X 27 + interconnect bridge with support for PCI and PCI-X bus interface. 28 + It is primarily used in industrial and embedded systems. 29 + 30 + To compile this driver as a module, say M - the module will be 31 + called vme_tsi148. If unsure, say N. 18 32 19 33 config VME_FAKE 20 34 tristate "Fake"
+2 -2
drivers/staging/vme_user/vme.c
··· 340 340 image = list_entry(resource->entry, struct vme_slave_resource, list); 341 341 342 342 if (!bridge->slave_set) { 343 - dev_err(bridge->parent, "Function not supported\n"); 344 - return -ENOSYS; 343 + dev_err(bridge->parent, "%s not supported\n", __func__); 344 + return -EINVAL; 345 345 } 346 346 347 347 if (!(((image->address_attr & aspace) == aspace) &&
+45 -45
drivers/staging/vt6655/card.c
··· 10 10 * CARDvUpdateBasicTopRate - Update BasicTopRate 11 11 * CARDbAddBasicRate - Add to BasicRateSet 12 12 * CARDbIsOFDMinBasicRate - Check if any OFDM rate is in BasicRateSet 13 - * CARDqGetTSFOffset - Calculate TSFOffset 13 + * card_get_tsf_offset - Calculate TSFOffset 14 14 * vt6655_get_current_tsf - Read Current NIC TSF counter 15 - * CARDqGetNextTBTT - Calculate Next Beacon TSF counter 15 + * card_get_next_tbtt - Calculate Next Beacon TSF counter 16 16 * CARDvSetFirstNextTBTT - Set NIC Beacon time 17 17 * CARDvUpdateNextTBTT - Sync. NIC Beacon time 18 - * CARDbRadioPowerOff - Turn Off NIC Radio Power 18 + * card_radio_power_off - Turn Off NIC Radio Power 19 19 * 20 20 * Revision History: 21 21 * 06-10-2003 Bryan YC Fan: Re-write codes to support VT3253 spec. ··· 280 280 * In: 281 281 * priv - The adapter to be sync. 282 282 * rx_rate - data rate of receive beacon 283 - * qwBSSTimestamp - Rx BCN's TSF 283 + * bss_timestamp - Rx BCN's TSF 284 284 * qwLocalTSF - Local TSF 285 285 * Out: 286 286 * none ··· 288 288 * Return Value: none 289 289 */ 290 290 bool card_update_tsf(struct vnt_private *priv, unsigned char rx_rate, 291 - u64 qwBSSTimestamp) 291 + u64 bss_timestamp) 292 292 { 293 293 u64 local_tsf; 294 - u64 qwTSFOffset = 0; 294 + u64 tsf_offset = 0; 295 295 296 296 local_tsf = vt6655_get_current_tsf(priv); 297 297 298 - if (qwBSSTimestamp != local_tsf) { 299 - qwTSFOffset = CARDqGetTSFOffset(rx_rate, qwBSSTimestamp, 298 + if (bss_timestamp != local_tsf) { 299 + tsf_offset = card_get_tsf_offset(rx_rate, bss_timestamp, 300 300 local_tsf); 301 301 /* adjust TSF, HW's TSF add TSF Offset reg */ 302 - qwTSFOffset = le64_to_cpu(qwTSFOffset); 303 - iowrite32((u32)qwTSFOffset, priv->port_offset + MAC_REG_TSFOFST); 304 - iowrite32((u32)(qwTSFOffset >> 32), priv->port_offset + MAC_REG_TSFOFST + 4); 302 + tsf_offset = le64_to_cpu(tsf_offset); 303 + iowrite32((u32)tsf_offset, priv->port_offset + MAC_REG_TSFOFST); 304 + iowrite32((u32)(tsf_offset >> 32), priv->port_offset + MAC_REG_TSFOFST + 4); 305 305 vt6655_mac_reg_bits_on(priv->port_offset, MAC_REG_TFTCTL, TFTCTL_TSFSYNCEN); 306 306 } 307 307 return true; ··· 314 314 * Parameters: 315 315 * In: 316 316 * priv - The adapter to be set. 317 - * wBeaconInterval - Beacon Interval 317 + * beacon_interval - Beacon Interval 318 318 * Out: 319 319 * none 320 320 * 321 321 * Return Value: true if succeed; otherwise false 322 322 */ 323 - bool CARDbSetBeaconPeriod(struct vnt_private *priv, 324 - unsigned short wBeaconInterval) 323 + bool card_set_beacon_period(struct vnt_private *priv, 324 + unsigned short beacon_interval) 325 325 { 326 - u64 qwNextTBTT; 326 + u64 next_tbtt; 327 327 328 - qwNextTBTT = vt6655_get_current_tsf(priv); /* Get Local TSF counter */ 328 + next_tbtt = vt6655_get_current_tsf(priv); /* Get Local TSF counter */ 329 329 330 - qwNextTBTT = CARDqGetNextTBTT(qwNextTBTT, wBeaconInterval); 330 + next_tbtt = card_get_next_tbtt(next_tbtt, beacon_interval); 331 331 332 332 /* set HW beacon interval */ 333 - iowrite16(wBeaconInterval, priv->port_offset + MAC_REG_BI); 334 - priv->wBeaconInterval = wBeaconInterval; 333 + iowrite16(beacon_interval, priv->port_offset + MAC_REG_BI); 334 + priv->beacon_interval = beacon_interval; 335 335 /* Set NextTBTT */ 336 - qwNextTBTT = le64_to_cpu(qwNextTBTT); 337 - iowrite32((u32)qwNextTBTT, priv->port_offset + MAC_REG_NEXTTBTT); 338 - iowrite32((u32)(qwNextTBTT >> 32), priv->port_offset + MAC_REG_NEXTTBTT + 4); 336 + next_tbtt = le64_to_cpu(next_tbtt); 337 + iowrite32((u32)next_tbtt, priv->port_offset + MAC_REG_NEXTTBTT); 338 + iowrite32((u32)(next_tbtt >> 32), priv->port_offset + MAC_REG_NEXTTBTT + 4); 339 339 vt6655_mac_reg_bits_on(priv->port_offset, MAC_REG_TFTCTL, TFTCTL_TBTTSYNCEN); 340 340 341 341 return true; ··· 351 351 * none 352 352 * 353 353 */ 354 - void CARDbRadioPowerOff(struct vnt_private *priv) 354 + void card_radio_power_off(struct vnt_private *priv) 355 355 { 356 356 if (priv->radio_off) 357 357 return; ··· 382 382 vt6655_mac_reg_bits_on(priv->port_offset, MAC_REG_GPIOCTL0, LED_ACTSET); /* LED issue */ 383 383 } 384 384 385 - void CARDvSafeResetTx(struct vnt_private *priv) 385 + void card_safe_reset_tx(struct vnt_private *priv) 386 386 { 387 387 unsigned int uu; 388 - struct vnt_tx_desc *pCurrTD; 388 + struct vnt_tx_desc *curr_td; 389 389 390 390 /* initialize TD index */ 391 - priv->apTailTD[0] = &priv->apTD0Rings[0]; 391 + priv->tail_td[0] = &priv->apTD0Rings[0]; 392 392 priv->apCurrTD[0] = &priv->apTD0Rings[0]; 393 393 394 - priv->apTailTD[1] = &priv->apTD1Rings[0]; 394 + priv->tail_td[1] = &priv->apTD1Rings[0]; 395 395 priv->apCurrTD[1] = &priv->apTD1Rings[0]; 396 396 397 397 for (uu = 0; uu < TYPE_MAXTD; uu++) 398 398 priv->iTDUsed[uu] = 0; 399 399 400 400 for (uu = 0; uu < priv->opts.tx_descs[0]; uu++) { 401 - pCurrTD = &priv->apTD0Rings[uu]; 402 - pCurrTD->td0.owner = OWNED_BY_HOST; 401 + curr_td = &priv->apTD0Rings[uu]; 402 + curr_td->td0.owner = OWNED_BY_HOST; 403 403 /* init all Tx Packet pointer to NULL */ 404 404 } 405 405 for (uu = 0; uu < priv->opts.tx_descs[1]; uu++) { 406 - pCurrTD = &priv->apTD1Rings[uu]; 407 - pCurrTD->td0.owner = OWNED_BY_HOST; 406 + curr_td = &priv->apTD1Rings[uu]; 407 + curr_td->td0.owner = OWNED_BY_HOST; 408 408 /* init all Tx Packet pointer to NULL */ 409 409 } 410 410 ··· 708 708 * 709 709 * Return Value: TSF Offset value 710 710 */ 711 - u64 CARDqGetTSFOffset(unsigned char rx_rate, u64 qwTSF1, u64 qwTSF2) 711 + u64 card_get_tsf_offset(unsigned char rx_rate, u64 qwTSF1, u64 qwTSF2) 712 712 { 713 713 unsigned short wRxBcnTSFOffst; 714 714 ··· 764 764 * 765 765 * Return Value: TSF value of next Beacon 766 766 */ 767 - u64 CARDqGetNextTBTT(u64 qwTSF, unsigned short wBeaconInterval) 767 + u64 card_get_next_tbtt(u64 qwTSF, unsigned short beacon_interval) 768 768 { 769 769 u32 beacon_int; 770 770 771 - beacon_int = wBeaconInterval * 1024; 771 + beacon_int = beacon_interval * 1024; 772 772 if (beacon_int) { 773 773 do_div(qwTSF, beacon_int); 774 774 qwTSF += 1; ··· 785 785 * Parameters: 786 786 * In: 787 787 * iobase - IO Base 788 - * wBeaconInterval - Beacon Interval 788 + * beacon_interval - Beacon Interval 789 789 * Out: 790 790 * none 791 791 * 792 792 * Return Value: none 793 793 */ 794 794 void CARDvSetFirstNextTBTT(struct vnt_private *priv, 795 - unsigned short wBeaconInterval) 795 + unsigned short beacon_interval) 796 796 { 797 797 void __iomem *iobase = priv->port_offset; 798 - u64 qwNextTBTT; 798 + u64 next_tbtt; 799 799 800 - qwNextTBTT = vt6655_get_current_tsf(priv); /* Get Local TSF counter */ 800 + next_tbtt = vt6655_get_current_tsf(priv); /* Get Local TSF counter */ 801 801 802 - qwNextTBTT = CARDqGetNextTBTT(qwNextTBTT, wBeaconInterval); 802 + next_tbtt = card_get_next_tbtt(next_tbtt, beacon_interval); 803 803 /* Set NextTBTT */ 804 - qwNextTBTT = le64_to_cpu(qwNextTBTT); 805 - iowrite32((u32)qwNextTBTT, iobase + MAC_REG_NEXTTBTT); 806 - iowrite32((u32)(qwNextTBTT >> 32), iobase + MAC_REG_NEXTTBTT + 4); 804 + next_tbtt = le64_to_cpu(next_tbtt); 805 + iowrite32((u32)next_tbtt, iobase + MAC_REG_NEXTTBTT); 806 + iowrite32((u32)(next_tbtt >> 32), iobase + MAC_REG_NEXTTBTT + 4); 807 807 vt6655_mac_reg_bits_on(iobase, MAC_REG_TFTCTL, TFTCTL_TBTTSYNCEN); 808 808 } 809 809 ··· 815 815 * In: 816 816 * priv - The adapter to be set 817 817 * qwTSF - Current TSF counter 818 - * wBeaconInterval - Beacon Interval 818 + * beacon_interval - Beacon Interval 819 819 * Out: 820 820 * none 821 821 * 822 822 * Return Value: none 823 823 */ 824 824 void CARDvUpdateNextTBTT(struct vnt_private *priv, u64 qwTSF, 825 - unsigned short wBeaconInterval) 825 + unsigned short beacon_interval) 826 826 { 827 827 void __iomem *iobase = priv->port_offset; 828 828 829 - qwTSF = CARDqGetNextTBTT(qwTSF, wBeaconInterval); 829 + qwTSF = card_get_next_tbtt(qwTSF, beacon_interval); 830 830 /* Set NextTBTT */ 831 831 qwTSF = le64_to_cpu(qwTSF); 832 832 iowrite32((u32)qwTSF, iobase + MAC_REG_NEXTTBTT);
+9 -9
drivers/staging/vt6655/card.h
··· 43 43 void CARDvUpdateBasicTopRate(struct vnt_private *priv); 44 44 bool CARDbIsOFDMinBasicRate(struct vnt_private *priv); 45 45 void CARDvSetFirstNextTBTT(struct vnt_private *priv, 46 - unsigned short wBeaconInterval); 46 + unsigned short beacon_interval); 47 47 void CARDvUpdateNextTBTT(struct vnt_private *priv, u64 qwTSF, 48 - unsigned short wBeaconInterval); 48 + unsigned short beacon_interval); 49 49 u64 vt6655_get_current_tsf(struct vnt_private *priv); 50 - u64 CARDqGetNextTBTT(u64 qwTSF, unsigned short wBeaconInterval); 51 - u64 CARDqGetTSFOffset(unsigned char rx_rate, u64 qwTSF1, u64 qwTSF2); 50 + u64 card_get_next_tbtt(u64 qwTSF, unsigned short beacon_interval); 51 + u64 card_get_tsf_offset(unsigned char rx_rate, u64 qwTSF1, u64 qwTSF2); 52 52 unsigned char card_get_pkt_type(struct vnt_private *priv); 53 - void CARDvSafeResetTx(struct vnt_private *priv); 53 + void card_safe_reset_tx(struct vnt_private *priv); 54 54 void CARDvSafeResetRx(struct vnt_private *priv); 55 - void CARDbRadioPowerOff(struct vnt_private *priv); 55 + void card_radio_power_off(struct vnt_private *priv); 56 56 bool card_set_phy_parameter(struct vnt_private *priv, u8 bb_type); 57 57 bool card_update_tsf(struct vnt_private *priv, unsigned char rx_rate, 58 - u64 qwBSSTimestamp); 59 - bool CARDbSetBeaconPeriod(struct vnt_private *priv, 60 - unsigned short wBeaconInterval); 58 + u64 bss_timestamp); 59 + bool card_set_beacon_period(struct vnt_private *priv, 60 + unsigned short beacon_interval); 61 61 62 62 #endif /* __CARD_H__ */
+2 -2
drivers/staging/vt6655/device.h
··· 133 133 volatile int iTDUsed[TYPE_MAXTD]; 134 134 135 135 struct vnt_tx_desc *apCurrTD[TYPE_MAXTD]; 136 - struct vnt_tx_desc *apTailTD[TYPE_MAXTD]; 136 + struct vnt_tx_desc *tail_td[TYPE_MAXTD]; 137 137 138 138 struct vnt_tx_desc *apTD0Rings; 139 139 struct vnt_tx_desc *apTD1Rings; ··· 281 281 282 282 unsigned char abyEEPROM[EEP_MAX_CONTEXT_SIZE]; /* unsigned long alignment */ 283 283 284 - unsigned short wBeaconInterval; 284 + unsigned short beacon_interval; 285 285 u16 wake_up_count; 286 286 287 287 struct work_struct interrupt_work;
+9 -9
drivers/staging/vt6655/device_main.c
··· 454 454 } 455 455 456 456 if (priv->hw_radio_off || priv->bRadioControlOff) 457 - CARDbRadioPowerOff(priv); 457 + card_radio_power_off(priv); 458 458 459 459 /* get Permanent network address */ 460 460 SROMvReadEtherAddress(priv->port_offset, priv->abyCurrentNetAddr); ··· 463 463 /* reset Tx pointer */ 464 464 CARDvSafeResetRx(priv); 465 465 /* reset Rx pointer */ 466 - CARDvSafeResetTx(priv); 466 + card_safe_reset_tx(priv); 467 467 468 468 if (priv->local_id <= REV_ID_VT3253_A1) 469 469 vt6655_mac_reg_bits_on(priv->port_offset, MAC_REG_RCR, RCR_WPAERR); ··· 737 737 738 738 if (i > 0) 739 739 priv->apTD0Rings[i - 1].next_desc = cpu_to_le32(priv->td0_pool_dma); 740 - priv->apTailTD[0] = priv->apCurrTD[0] = &priv->apTD0Rings[0]; 740 + priv->tail_td[0] = priv->apCurrTD[0] = &priv->apTD0Rings[0]; 741 741 742 742 return 0; 743 743 ··· 777 777 778 778 if (i > 0) 779 779 priv->apTD1Rings[i - 1].next_desc = cpu_to_le32(priv->td1_pool_dma); 780 - priv->apTailTD[1] = priv->apCurrTD[1] = &priv->apTD1Rings[0]; 780 + priv->tail_td[1] = priv->apCurrTD[1] = &priv->apTD1Rings[0]; 781 781 782 782 return 0; 783 783 ··· 969 969 unsigned char byTsr0; 970 970 unsigned char byTsr1; 971 971 972 - for (desc = priv->apTailTD[idx]; priv->iTDUsed[idx] > 0; desc = desc->next) { 972 + for (desc = priv->tail_td[idx]; priv->iTDUsed[idx] > 0; desc = desc->next) { 973 973 if (desc->td0.owner == OWNED_BY_NIC) 974 974 break; 975 975 if (works++ > 15) ··· 1007 1007 } 1008 1008 } 1009 1009 1010 - priv->apTailTD[idx] = desc; 1010 + priv->tail_td[idx] = desc; 1011 1011 1012 1012 return works; 1013 1013 } ··· 1349 1349 1350 1350 MACbShutdown(priv); 1351 1351 MACbSoftwareReset(priv); 1352 - CARDbRadioPowerOff(priv); 1352 + card_radio_power_off(priv); 1353 1353 1354 1354 device_free_td0_ring(priv); 1355 1355 device_free_td1_ring(priv); ··· 1537 1537 card_update_tsf(priv, conf->beacon_rate->hw_value, 1538 1538 conf->sync_tsf); 1539 1539 1540 - CARDbSetBeaconPeriod(priv, conf->beacon_int); 1540 + card_set_beacon_period(priv, conf->beacon_int); 1541 1541 1542 1542 CARDvSetFirstNextTBTT(priv, conf->beacon_int); 1543 1543 } else { ··· 1712 1712 1713 1713 priv->mac_hw = true; 1714 1714 1715 - CARDbRadioPowerOff(priv); 1715 + card_radio_power_off(priv); 1716 1716 1717 1717 return 0; 1718 1718 }
+1 -1
drivers/staging/vt6655/rxtx.c
··· 1456 1456 1457 1457 CARDvSetFirstNextTBTT(priv, conf->beacon_int); 1458 1458 1459 - CARDbSetBeaconPeriod(priv, conf->beacon_int); 1459 + card_set_beacon_period(priv, conf->beacon_int); 1460 1460 1461 1461 return vnt_beacon_make(priv, vif); 1462 1462 }