mirror of
https://github.com/Mange/rtl8192eu-linux-driver
synced 2024-11-25 15:04:59 +00:00
Merge pull request #247 from CGarces/staging_cherrypick2
Adapted commits from staging area (second part)
This commit is contained in:
commit
7c6ae2277b
@ -1985,7 +1985,7 @@ ReadEFuseByte(
|
||||
/* This fix the problem that Efuse read error in high temperature condition. */
|
||||
/* Designer says that there shall be some delay after ready bit is set, or the */
|
||||
/* result will always stay on last data we read. */
|
||||
rtw_udelay_os(50);
|
||||
udelay(50);
|
||||
value32 = rtw_read32(Adapter, EFUSE_CTRL);
|
||||
|
||||
*pbuf = (u8)(value32 & 0xff);
|
||||
@ -2097,7 +2097,7 @@ efuse_OneByteRead(
|
||||
rtw_write8(pAdapter, EFUSE_CTRL + 3, (readbyte & 0x7f));
|
||||
|
||||
while (!(0x80 & rtw_read8(pAdapter, EFUSE_CTRL + 3)) && (tmpidx < 1000)) {
|
||||
rtw_mdelay_os(1);
|
||||
mdelay(1);
|
||||
tmpidx++;
|
||||
}
|
||||
if (tmpidx < 100) {
|
||||
@ -2158,10 +2158,10 @@ efuse_OneByteWrite(
|
||||
} else
|
||||
rtw_write32(pAdapter, EFUSE_CTRL, efuseValue);
|
||||
|
||||
rtw_mdelay_os(1);
|
||||
mdelay(1);
|
||||
|
||||
while ((0x80 & rtw_read8(pAdapter, EFUSE_CTRL + 3)) && (tmpidx < 100)) {
|
||||
rtw_mdelay_os(1);
|
||||
mdelay(1);
|
||||
tmpidx++;
|
||||
}
|
||||
|
||||
@ -3144,9 +3144,9 @@ u32 rtw_read_efuse_from_file(const char *path, u8 *buf, int map_size)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
file_data = rtw_vmalloc(file_size);
|
||||
file_data = vmalloc(file_size);
|
||||
if (!file_data) {
|
||||
RTW_ERR("%s rtw_vmalloc(%d) fail\n", __func__, file_size);
|
||||
RTW_ERR("%s vmalloc(%d) fail\n", __func__, file_size);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@ -3156,9 +3156,9 @@ u32 rtw_read_efuse_from_file(const char *path, u8 *buf, int map_size)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
map = rtw_vmalloc(map_size);
|
||||
map = vmalloc(map_size);
|
||||
if (!map) {
|
||||
RTW_ERR("%s rtw_vmalloc(%d) fail\n", __func__, map_size);
|
||||
RTW_ERR("%s vmalloc(%d) fail\n", __func__, map_size);
|
||||
goto exit;
|
||||
}
|
||||
memset(map, 0xff, map_size);
|
||||
|
@ -1077,7 +1077,7 @@ void dump_mesh_networks(void *sel, _adapter *adapter)
|
||||
u8 mesh_network_cnt = 0;
|
||||
int i;
|
||||
|
||||
mesh_networks = rtw_zvmalloc(mlme->max_bss_cnt * sizeof(struct wlan_network *));
|
||||
mesh_networks = vzalloc(mlme->max_bss_cnt * sizeof(struct wlan_network *));
|
||||
if (!mesh_networks)
|
||||
return;
|
||||
|
||||
|
@ -1089,10 +1089,10 @@ void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta)
|
||||
/* check if sta supports rx ampdu */
|
||||
phtpriv_sta->ampdu_enable = phtpriv_ap->ampdu_enable;
|
||||
|
||||
phtpriv_sta->rx_ampdu_min_spacing = (phtpriv_sta->ht_cap.ampdu_params_info & IEEE80211_HT_CAP_AMPDU_DENSITY) >> 2;
|
||||
phtpriv_sta->rx_ampdu_min_spacing = (phtpriv_sta->ht_cap.ampdu_params_info & IEEE80211_HT_AMPDU_PARM_DENSITY) >> 2;
|
||||
|
||||
/* bwmode */
|
||||
if ((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH))
|
||||
if ((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH_20_40))
|
||||
psta->cmn.bw_mode = CHANNEL_WIDTH_40;
|
||||
else
|
||||
psta->cmn.bw_mode = CHANNEL_WIDTH_20;
|
||||
@ -2271,20 +2271,20 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
||||
pht_cap->cap_info &= ~(IEEE80211_HT_CAP_TX_STBC);
|
||||
|
||||
if (!TEST_FLAG(pmlmepriv->htpriv.stbc_cap, STBC_HT_ENABLE_RX))
|
||||
pht_cap->cap_info &= ~(IEEE80211_HT_CAP_RX_STBC_3R);
|
||||
pht_cap->cap_info &= ~(IEEE80211_HT_CAP_RX_STBC);
|
||||
|
||||
/* Update A-MPDU Parameters field */
|
||||
pht_cap->ampdu_params_info &= ~(IEEE80211_HT_CAP_AMPDU_FACTOR | IEEE80211_HT_CAP_AMPDU_DENSITY);
|
||||
pht_cap->ampdu_params_info &= ~(IEEE80211_HT_AMPDU_PARM_FACTOR | IEEE80211_HT_AMPDU_PARM_DENSITY);
|
||||
|
||||
if ((psecuritypriv->wpa_pairwise_cipher & WPA_CIPHER_CCMP) ||
|
||||
(psecuritypriv->wpa2_pairwise_cipher & WPA_CIPHER_CCMP)) {
|
||||
rtw_hal_get_def_var(padapter, HW_VAR_BEST_AMPDU_DENSITY, &best_ampdu_density);
|
||||
pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY & (best_ampdu_density << 2));
|
||||
pht_cap->ampdu_params_info |= (IEEE80211_HT_AMPDU_PARM_DENSITY & (best_ampdu_density << 2));
|
||||
} else
|
||||
pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY & 0x00);
|
||||
pht_cap->ampdu_params_info |= (IEEE80211_HT_AMPDU_PARM_DENSITY & 0x00);
|
||||
|
||||
rtw_hal_get_def_var(padapter, HW_VAR_MAX_RX_AMPDU_FACTOR, &max_rx_ampdu_factor);
|
||||
pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_FACTOR & max_rx_ampdu_factor); /* set Max Rx AMPDU size to 64K */
|
||||
pht_cap->ampdu_params_info |= (IEEE80211_HT_AMPDU_PARM_FACTOR & max_rx_ampdu_factor); /* set Max Rx AMPDU size to 64K */
|
||||
|
||||
_rtw_memcpy(&(pmlmeinfo->HT_caps), pht_cap, sizeof(struct HT_caps_element));
|
||||
|
||||
@ -3482,7 +3482,7 @@ int rtw_ht_operation_update(_adapter *padapter)
|
||||
if (pmlmepriv->num_sta_no_ht /*||
|
||||
(pmlmepriv->ht_op_mode & HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT)*/)
|
||||
new_op_mode = OP_MODE_MIXED;
|
||||
else if ((phtpriv_ap->ht_cap.cap_info & IEEE80211_HT_CAP_SUP_WIDTH)
|
||||
else if ((phtpriv_ap->ht_cap.cap_info & IEEE80211_HT_CAP_SUP_WIDTH_20_40)
|
||||
&& pmlmepriv->num_sta_ht_20mhz)
|
||||
new_op_mode = OP_MODE_20MHZ_HT_STA_ASSOCED;
|
||||
else if (atomic_read(&pmlmepriv->olbc_ht))
|
||||
@ -3671,7 +3671,7 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
|
||||
pmlmepriv->num_sta_ht_no_gf);
|
||||
}
|
||||
|
||||
if ((ht_capab & IEEE80211_HT_CAP_SUP_WIDTH) == 0) {
|
||||
if ((ht_capab & IEEE80211_HT_CAP_SUP_WIDTH_20_40) == 0) {
|
||||
if (!psta->ht_20mhz_set) {
|
||||
psta->ht_20mhz_set = 1;
|
||||
pmlmepriv->num_sta_ht_20mhz++;
|
||||
@ -3682,7 +3682,7 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
|
||||
pmlmepriv->num_sta_ht_20mhz);
|
||||
}
|
||||
|
||||
if (((ht_capab & RTW_IEEE80211_HT_CAP_40MHZ_INTOLERANT) != 0) &&
|
||||
if (((ht_capab & IEEE80211_HT_CAP_40MHZ_INTOLERANT) != 0) &&
|
||||
(psta->ht_40mhz_intolerant == 0)) {
|
||||
psta->ht_40mhz_intolerant = 1;
|
||||
pmlmepriv->num_sta_40mhz_intolerant++;
|
||||
|
@ -84,7 +84,7 @@
|
||||
|
||||
|
||||
/* Find a tag in pppoe frame and return the pointer */
|
||||
static __inline__ unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsigned short type)
|
||||
static unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsigned short type)
|
||||
{
|
||||
unsigned char *cur_ptr, *start_ptr;
|
||||
unsigned short tagLen, tagType;
|
||||
@ -102,7 +102,7 @@ static __inline__ unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, un
|
||||
}
|
||||
|
||||
|
||||
static __inline__ int __nat25_add_pppoe_tag(struct sk_buff *skb, struct pppoe_tag *tag)
|
||||
static int __nat25_add_pppoe_tag(struct sk_buff *skb, struct pppoe_tag *tag)
|
||||
{
|
||||
struct pppoe_hdr *ph = (struct pppoe_hdr *)(skb->data + ETH_HLEN);
|
||||
int data_len;
|
||||
@ -142,7 +142,7 @@ static int skb_pull_and_merge(struct sk_buff *skb, unsigned char *src, int len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static __inline__ unsigned long __nat25_timeout(_adapter *priv)
|
||||
static unsigned long __nat25_timeout(_adapter *priv)
|
||||
{
|
||||
unsigned long timeout;
|
||||
|
||||
@ -152,7 +152,7 @@ static __inline__ unsigned long __nat25_timeout(_adapter *priv)
|
||||
}
|
||||
|
||||
|
||||
static __inline__ int __nat25_has_expired(_adapter *priv,
|
||||
static int __nat25_has_expired(_adapter *priv,
|
||||
struct nat25_network_db_entry *fdb)
|
||||
{
|
||||
if (time_before_eq(fdb->ageing_timer, __nat25_timeout(priv)))
|
||||
@ -162,7 +162,7 @@ static __inline__ int __nat25_has_expired(_adapter *priv,
|
||||
}
|
||||
|
||||
|
||||
static __inline__ void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr,
|
||||
static void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr,
|
||||
unsigned int *ipAddr)
|
||||
{
|
||||
memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
|
||||
@ -172,7 +172,7 @@ static __inline__ void __nat25_generate_ipv4_network_addr(unsigned char *network
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
|
||||
static __inline__ void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
|
||||
static void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
|
||||
unsigned int *ipxNetAddr, unsigned char *ipxNodeAddr)
|
||||
{
|
||||
memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
|
||||
@ -183,7 +183,7 @@ static __inline__ void __nat25_generate_ipx_network_addr_with_node(unsigned char
|
||||
}
|
||||
|
||||
|
||||
static __inline__ void __nat25_generate_ipx_network_addr_with_socket(unsigned char *networkAddr,
|
||||
static void __nat25_generate_ipx_network_addr_with_socket(unsigned char *networkAddr,
|
||||
unsigned int *ipxNetAddr, unsigned short *ipxSocketAddr)
|
||||
{
|
||||
memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
|
||||
@ -194,7 +194,7 @@ static __inline__ void __nat25_generate_ipx_network_addr_with_socket(unsigned ch
|
||||
}
|
||||
|
||||
|
||||
static __inline__ void __nat25_generate_apple_network_addr(unsigned char *networkAddr,
|
||||
static void __nat25_generate_apple_network_addr(unsigned char *networkAddr,
|
||||
unsigned short *network, unsigned char *node)
|
||||
{
|
||||
memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
|
||||
@ -205,7 +205,7 @@ static __inline__ void __nat25_generate_apple_network_addr(unsigned char *networ
|
||||
}
|
||||
#endif
|
||||
|
||||
static __inline__ void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
|
||||
static void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
|
||||
unsigned char *ac_mac, unsigned short *sid)
|
||||
{
|
||||
memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
|
||||
@ -325,7 +325,7 @@ static void convert_ipv6_mac_to_mc(struct sk_buff *skb)
|
||||
#endif /* SUPPORT_RX_UNI2MCAST */
|
||||
|
||||
|
||||
static __inline__ int __nat25_network_hash(unsigned char *networkAddr)
|
||||
static int __nat25_network_hash(unsigned char *networkAddr)
|
||||
{
|
||||
if (networkAddr[0] == NAT25_IPV4) {
|
||||
unsigned long x;
|
||||
@ -377,7 +377,7 @@ static __inline__ int __nat25_network_hash(unsigned char *networkAddr)
|
||||
}
|
||||
|
||||
|
||||
static __inline__ void __network_hash_link(_adapter *priv,
|
||||
static void __network_hash_link(_adapter *priv,
|
||||
struct nat25_network_db_entry *ent, int hash)
|
||||
{
|
||||
/* Caller must _enter_critical_bh already! */
|
||||
@ -394,7 +394,7 @@ static __inline__ void __network_hash_link(_adapter *priv,
|
||||
}
|
||||
|
||||
|
||||
static __inline__ void __network_hash_unlink(struct nat25_network_db_entry *ent)
|
||||
static void __network_hash_unlink(struct nat25_network_db_entry *ent)
|
||||
{
|
||||
/* Caller must _enter_critical_bh already! */
|
||||
/* _irqL irqL; */
|
||||
|
@ -22,7 +22,7 @@ void up_clk(_adapter *padapter, u16 *x)
|
||||
{
|
||||
*x = *x | _EESK;
|
||||
rtw_write8(padapter, EE_9346CR, (u8)*x);
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
udelay(CLOCK_RATE);
|
||||
|
||||
|
||||
}
|
||||
@ -31,7 +31,7 @@ void down_clk(_adapter *padapter, u16 *x)
|
||||
{
|
||||
*x = *x & ~_EESK;
|
||||
rtw_write8(padapter, EE_9346CR, (u8)*x);
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
udelay(CLOCK_RATE);
|
||||
}
|
||||
|
||||
void shift_out_bits(_adapter *padapter, u16 data, u16 count)
|
||||
@ -54,7 +54,7 @@ void shift_out_bits(_adapter *padapter, u16 data, u16 count)
|
||||
goto out;
|
||||
}
|
||||
rtw_write8(padapter, EE_9346CR, (u8)x);
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
udelay(CLOCK_RATE);
|
||||
up_clk(padapter, &x);
|
||||
down_clk(padapter, &x);
|
||||
mask = mask >> 1;
|
||||
@ -106,10 +106,10 @@ void standby(_adapter *padapter)
|
||||
x &= ~(_EECS | _EESK);
|
||||
rtw_write8(padapter, EE_9346CR, x);
|
||||
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
udelay(CLOCK_RATE);
|
||||
x |= _EECS;
|
||||
rtw_write8(padapter, EE_9346CR, x);
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
udelay(CLOCK_RATE);
|
||||
}
|
||||
|
||||
u16 wait_eeprom_cmd_done(_adapter *padapter)
|
||||
@ -123,7 +123,7 @@ u16 wait_eeprom_cmd_done(_adapter *padapter)
|
||||
res = _TRUE;
|
||||
goto exit;
|
||||
}
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
udelay(CLOCK_RATE);
|
||||
}
|
||||
exit:
|
||||
return res;
|
||||
|
@ -20,13 +20,6 @@
|
||||
|
||||
extern void indicate_wx_scan_complete_event(_adapter *padapter);
|
||||
|
||||
#define IS_MAC_ADDRESS_BROADCAST(addr) \
|
||||
(\
|
||||
((addr[0] == 0xff) && (addr[1] == 0xff) && \
|
||||
(addr[2] == 0xff) && (addr[3] == 0xff) && \
|
||||
(addr[4] == 0xff) && (addr[5] == 0xff)) ? _TRUE : _FALSE \
|
||||
)
|
||||
|
||||
u8 rtw_validate_bssid(u8 *bssid)
|
||||
{
|
||||
u8 ret = _TRUE;
|
||||
|
@ -47,7 +47,7 @@ sint _rtw_init_mlme_priv(_adapter *padapter)
|
||||
sint res = _SUCCESS;
|
||||
|
||||
|
||||
/* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */
|
||||
/* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */
|
||||
/* memset((u8 *)pmlmepriv, 0, sizeof(struct mlme_priv)); */
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@ sint _rtw_init_mlme_priv(_adapter *padapter)
|
||||
pmlmepriv->max_bss_cnt = MAX_BSS_CNT + MAX_BSS_CNT;
|
||||
|
||||
|
||||
pbuf = rtw_zvmalloc(pmlmepriv->max_bss_cnt * (sizeof(struct wlan_network)));
|
||||
pbuf = vzalloc(pmlmepriv->max_bss_cnt * (sizeof(struct wlan_network)));
|
||||
|
||||
if (pbuf == NULL) {
|
||||
res = _FAIL;
|
||||
@ -4704,7 +4704,7 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui
|
||||
}
|
||||
|
||||
if (oper_bw == CHANNEL_WIDTH_40) {
|
||||
ht_capie.cap_info |= IEEE80211_HT_CAP_SUP_WIDTH;
|
||||
ht_capie.cap_info |= IEEE80211_HT_CAP_SUP_WIDTH_20_40;
|
||||
if (phtpriv->sgi_40m)
|
||||
ht_capie.cap_info |= IEEE80211_HT_CAP_SGI_40;
|
||||
}
|
||||
@ -4786,7 +4786,7 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui
|
||||
#if defined(CONFIG_RTL8188E) && defined(CONFIG_SDIO_HCI)
|
||||
ht_capie.ampdu_params_info = 2;
|
||||
#else
|
||||
ht_capie.ampdu_params_info = (IEEE80211_HT_CAP_AMPDU_FACTOR&0x03);
|
||||
ht_capie.ampdu_params_info = (IEEE80211_HT_AMPDU_PARM_FACTOR&0x03);
|
||||
#endif
|
||||
*/
|
||||
|
||||
@ -4808,10 +4808,10 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui
|
||||
*/
|
||||
rtw_hal_get_def_var(padapter, HW_VAR_BEST_AMPDU_DENSITY, &best_ampdu_density);
|
||||
|
||||
ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY & (best_ampdu_density << 2));
|
||||
ht_capie.ampdu_params_info |= (IEEE80211_HT_AMPDU_PARM_DENSITY & (best_ampdu_density << 2));
|
||||
|
||||
} else
|
||||
ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY & 0x00);
|
||||
ht_capie.ampdu_params_info |= (IEEE80211_HT_AMPDU_PARM_DENSITY & 0x00);
|
||||
}
|
||||
#ifdef CONFIG_BEAMFORMING
|
||||
ht_capie.tx_BF_cap_info = 0;
|
||||
@ -4906,7 +4906,7 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len, u8 channel)
|
||||
p = rtw_get_ie(pie + sizeof(NDIS_802_11_FIXED_IEs), _HT_CAPABILITY_IE_, &len, ie_len - sizeof(NDIS_802_11_FIXED_IEs));
|
||||
if (p && len > 0) {
|
||||
pht_capie = (struct rtw_ieee80211_ht_cap *)(p + 2);
|
||||
max_ampdu_sz = (pht_capie->ampdu_params_info & IEEE80211_HT_CAP_AMPDU_FACTOR);
|
||||
max_ampdu_sz = (pht_capie->ampdu_params_info & IEEE80211_HT_AMPDU_PARM_FACTOR);
|
||||
max_ampdu_sz = 1 << (max_ampdu_sz + 3); /* max_ampdu_sz (kbytes); */
|
||||
|
||||
/* RTW_INFO("rtw_update_ht_cap(): max_ampdu_sz=%d\n", max_ampdu_sz); */
|
||||
|
@ -1130,7 +1130,7 @@ int init_mlme_ext_priv(_adapter *padapter)
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
/* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */
|
||||
/* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */
|
||||
/* memset((u8 *)pmlmeext, 0, sizeof(struct mlme_ext_priv)); */
|
||||
|
||||
pmlmeext->padapter = padapter;
|
||||
@ -10147,8 +10147,8 @@ static int issue_action_ba(_adapter *padapter, unsigned char *raddr, unsigned ch
|
||||
BA_para_set &= ~IEEE80211_ADDBA_PARAM_TID_MASK;
|
||||
BA_para_set |= (tid << 2) & IEEE80211_ADDBA_PARAM_TID_MASK;
|
||||
|
||||
BA_para_set &= ~RTW_IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK;
|
||||
BA_para_set |= (size << 6) & RTW_IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK;
|
||||
BA_para_set &= ~IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK ;
|
||||
BA_para_set |= (size << 6) & IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK ;
|
||||
|
||||
if (!padapter->registrypriv.wifi_spec) {
|
||||
if (pregpriv->rx_ampdu_amsdu == 0) /* disabled */
|
||||
@ -12176,7 +12176,7 @@ void update_sta_info(_adapter *padapter, struct sta_info *psta)
|
||||
|
||||
psta->htpriv.ampdu_enable = pmlmepriv->htpriv.ampdu_enable;
|
||||
|
||||
psta->htpriv.rx_ampdu_min_spacing = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & IEEE80211_HT_CAP_AMPDU_DENSITY) >> 2;
|
||||
psta->htpriv.rx_ampdu_min_spacing = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & IEEE80211_HT_AMPDU_PARM_DENSITY) >> 2;
|
||||
|
||||
if (support_short_GI(padapter, &(pmlmeinfo->HT_caps), CHANNEL_WIDTH_20))
|
||||
psta->htpriv.sgi_20m = _TRUE;
|
||||
|
@ -2388,11 +2388,11 @@ static u32 rtw_GetPSDData(PADAPTER pAdapter, u32 point)
|
||||
psd_val |= point;
|
||||
|
||||
rtw_write32(pAdapter, psd_reg, psd_val);
|
||||
rtw_mdelay_os(1);
|
||||
mdelay(1);
|
||||
psd_val |= 0x00400000;
|
||||
|
||||
rtw_write32(pAdapter, psd_reg, psd_val);
|
||||
rtw_mdelay_os(1);
|
||||
mdelay(1);
|
||||
|
||||
psd_val = rtw_read32(pAdapter, psd_regL);
|
||||
#if defined(CONFIG_RTL8821C)
|
||||
@ -2457,7 +2457,7 @@ u32 mp_query_psd(PADAPTER pAdapter, u8 *data)
|
||||
#ifdef CONFIG_LONG_DELAY_ISSUE
|
||||
msleep(100);
|
||||
#else
|
||||
rtw_mdelay_os(100);
|
||||
mdelay(100);
|
||||
#endif
|
||||
|
||||
if (psd_analysis)
|
||||
@ -2505,7 +2505,7 @@ void _rtw_mp_xmit_priv(struct xmit_priv *pxmitpriv)
|
||||
/* Init xmit extension buff */
|
||||
_rtw_init_queue(&pxmitpriv->free_xmit_extbuf_queue);
|
||||
|
||||
pxmitpriv->pallocated_xmit_extbuf = rtw_zvmalloc(num_xmit_extbuf * sizeof(struct xmit_buf) + 4);
|
||||
pxmitpriv->pallocated_xmit_extbuf = vzalloc(num_xmit_extbuf * sizeof(struct xmit_buf) + 4);
|
||||
|
||||
if (pxmitpriv->pallocated_xmit_extbuf == NULL) {
|
||||
res = _FAIL;
|
||||
|
@ -781,7 +781,7 @@ void rtw_set_fw_in_ips_mode(PADAPTER padapter, u8 enable)
|
||||
cnt++;
|
||||
RTW_INFO("%s polling REG_HMETFR=0x%x, cnt=%d\n",
|
||||
__func__, val8, cnt);
|
||||
rtw_mdelay_os(10);
|
||||
mdelay(10);
|
||||
} while (cnt < 100 && (val8 != 0));
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
@ -806,7 +806,7 @@ void rtw_set_fw_in_ips_mode(PADAPTER padapter, u8 enable)
|
||||
__func__,
|
||||
rtw_read8(padapter, 0x08),
|
||||
rtw_read8(padapter, 0x03));
|
||||
rtw_mdelay_os(10);
|
||||
mdelay(10);
|
||||
} while (cnt < 20 && (val8 != 0xEA));
|
||||
}
|
||||
}
|
||||
@ -832,7 +832,7 @@ void rtw_set_fw_in_ips_mode(PADAPTER padapter, u8 enable)
|
||||
start_time = rtw_get_current_time();
|
||||
do {
|
||||
|
||||
rtw_mdelay_os(1);
|
||||
mdelay(1);
|
||||
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_CPWM, &cpwm_now);
|
||||
if ((cpwm_orig ^ cpwm_now) & 0x80)
|
||||
|
@ -80,7 +80,7 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, _adapter *padapter)
|
||||
sint res = _SUCCESS;
|
||||
|
||||
|
||||
/* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */
|
||||
/* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */
|
||||
/* memset((unsigned char *)precvpriv, 0, sizeof (struct recv_priv)); */
|
||||
|
||||
_rtw_spinlock_init(&precvpriv->lock);
|
||||
@ -110,7 +110,7 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, _adapter *padapter)
|
||||
|
||||
rtw_os_recv_resource_init(precvpriv, padapter);
|
||||
|
||||
precvpriv->pallocated_frame_buf = rtw_zvmalloc(NR_RECVFRAME * sizeof(union recv_frame) + RXFRAME_ALIGN_SZ);
|
||||
precvpriv->pallocated_frame_buf = vzalloc(NR_RECVFRAME * sizeof(union recv_frame) + RXFRAME_ALIGN_SZ);
|
||||
|
||||
if (precvpriv->pallocated_frame_buf == NULL) {
|
||||
res = _FAIL;
|
||||
@ -1113,7 +1113,7 @@ void count_rx_stats(_adapter *padapter, union recv_frame *prframe, struct sta_in
|
||||
|
||||
padapter->mlmepriv.LinkDetectInfo.NumRxOkInPeriod++;
|
||||
|
||||
if ((!MacAddr_isBcst(pattrib->dst)) && (!IS_MCAST(pattrib->dst)))
|
||||
if (!is_broadcast_ether_addr(pattrib->dst) && !IS_MCAST(pattrib->dst))
|
||||
padapter->mlmepriv.LinkDetectInfo.NumRxUnicastOkInPeriod++;
|
||||
|
||||
if (sta)
|
||||
|
@ -1056,7 +1056,7 @@ void rtw_txpwr_lmt_add_with_nlen(struct rf_ctl_t *rfctl, const char *regd_name,
|
||||
}
|
||||
|
||||
/* alloc new one */
|
||||
ent = (struct txpwr_lmt_ent *)rtw_zvmalloc(sizeof(struct txpwr_lmt_ent) + nlen + 1);
|
||||
ent = (struct txpwr_lmt_ent *)vzalloc(sizeof(struct txpwr_lmt_ent) + nlen + 1);
|
||||
if (!ent)
|
||||
goto release_lock;
|
||||
|
||||
|
@ -237,7 +237,7 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
|
||||
|
||||
pstapriv->padapter = adapter;
|
||||
|
||||
pstapriv->pallocated_stainfo_buf = rtw_zvmalloc(sizeof(struct sta_info) * NUM_STA + 4);
|
||||
pstapriv->pallocated_stainfo_buf = vzalloc(sizeof(struct sta_info) * NUM_STA + 4);
|
||||
if (!pstapriv->pallocated_stainfo_buf)
|
||||
goto exit;
|
||||
|
||||
@ -713,7 +713,7 @@ u32 rtw_free_stainfo(_adapter *padapter , struct sta_info *psta)
|
||||
|
||||
}
|
||||
|
||||
if (!((psta->state & WIFI_AP_STATE) || MacAddr_isBcst(psta->cmn.mac_addr)) && is_pre_link_sta == _FALSE)
|
||||
if (!((psta->state & WIFI_AP_STATE) || is_broadcast_ether_addr(psta->cmn.mac_addr)) && is_pre_link_sta == _FALSE)
|
||||
rtw_hal_set_odm_var(padapter, HAL_ODM_STA_INFO, psta, _FALSE);
|
||||
|
||||
|
||||
|
@ -474,7 +474,7 @@ void rtw_tdls_process_ht_cap(_adapter *padapter, struct sta_info *ptdls_sta, u8
|
||||
ptdls_sta->htpriv.sgi_40m = _TRUE;
|
||||
|
||||
/* Bwmode would still followed AP's setting */
|
||||
if (ptdls_sta->htpriv.ht_cap.cap_info & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH)) {
|
||||
if (ptdls_sta->htpriv.ht_cap.cap_info & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH_20_40)) {
|
||||
if (padapter->mlmeextpriv.cur_bwmode >= CHANNEL_WIDTH_40)
|
||||
ptdls_sta->cmn.bw_mode = CHANNEL_WIDTH_40;
|
||||
ptdls_sta->htpriv.ch_offset = padapter->mlmeextpriv.cur_ch_offset;
|
||||
@ -2376,7 +2376,7 @@ int On_TDLS_Dis_Req(_adapter *padapter, union recv_frame *precv_frame)
|
||||
if (psta_ap == NULL)
|
||||
goto exit;
|
||||
dst = pIE->data + 12;
|
||||
if (MacAddr_isBcst(dst) == _FALSE && (_rtw_memcmp(adapter_mac_addr(padapter), dst, ETH_ALEN) == _FALSE))
|
||||
if (MacAddr_isMulticast(dst) == _FALSE && (_rtw_memcmp(adapter_mac_addr(padapter), dst, ETH_ALEN) == _FALSE))
|
||||
goto exit;
|
||||
break;
|
||||
default:
|
||||
|
@ -71,7 +71,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter)
|
||||
sint res = _SUCCESS;
|
||||
|
||||
|
||||
/* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */
|
||||
/* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */
|
||||
/* memset((unsigned char *)pxmitpriv, 0, sizeof(struct xmit_priv)); */
|
||||
|
||||
_rtw_spinlock_init(&pxmitpriv->lock);
|
||||
@ -104,7 +104,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter)
|
||||
Please also apply free_txobj to link_up all the xmit_frames...
|
||||
*/
|
||||
|
||||
pxmitpriv->pallocated_frame_buf = rtw_zvmalloc(NR_XMITFRAME * sizeof(struct xmit_frame) + 4);
|
||||
pxmitpriv->pallocated_frame_buf = vzalloc(NR_XMITFRAME * sizeof(struct xmit_frame) + 4);
|
||||
|
||||
if (pxmitpriv->pallocated_frame_buf == NULL) {
|
||||
pxmitpriv->pxmit_frame_buf = NULL;
|
||||
@ -142,7 +142,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter)
|
||||
_rtw_init_queue(&pxmitpriv->free_xmitbuf_queue);
|
||||
_rtw_init_queue(&pxmitpriv->pending_xmitbuf_queue);
|
||||
|
||||
pxmitpriv->pallocated_xmitbuf = rtw_zvmalloc(NR_XMITBUFF * sizeof(struct xmit_buf) + 4);
|
||||
pxmitpriv->pallocated_xmitbuf = vzalloc(NR_XMITBUFF * sizeof(struct xmit_buf) + 4);
|
||||
|
||||
if (pxmitpriv->pallocated_xmitbuf == NULL) {
|
||||
res = _FAIL;
|
||||
@ -194,7 +194,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter)
|
||||
/* init xframe_ext queue, the same count as extbuf */
|
||||
_rtw_init_queue(&pxmitpriv->free_xframe_ext_queue);
|
||||
|
||||
pxmitpriv->xframe_ext_alloc_addr = rtw_zvmalloc(NR_XMIT_EXTBUFF * sizeof(struct xmit_frame) + 4);
|
||||
pxmitpriv->xframe_ext_alloc_addr = vzalloc(NR_XMIT_EXTBUFF * sizeof(struct xmit_frame) + 4);
|
||||
|
||||
if (pxmitpriv->xframe_ext_alloc_addr == NULL) {
|
||||
pxmitpriv->xframe_ext = NULL;
|
||||
@ -226,7 +226,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter)
|
||||
/* Init xmit extension buff */
|
||||
_rtw_init_queue(&pxmitpriv->free_xmit_extbuf_queue);
|
||||
|
||||
pxmitpriv->pallocated_xmit_extbuf = rtw_zvmalloc(NR_XMIT_EXTBUFF * sizeof(struct xmit_buf) + 4);
|
||||
pxmitpriv->pallocated_xmit_extbuf = vzalloc(NR_XMIT_EXTBUFF * sizeof(struct xmit_buf) + 4);
|
||||
|
||||
if (pxmitpriv->pallocated_xmit_extbuf == NULL) {
|
||||
res = _FAIL;
|
||||
@ -4418,7 +4418,7 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
|
||||
#endif
|
||||
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
|
||||
if (pmgntframe == NULL) {
|
||||
rtw_udelay_os(500);
|
||||
udelay(500);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ u8 HalPwrSeqCmdParsing(
|
||||
if (value == (GET_PWR_CFG_VALUE(PwrCfgCmd) & GET_PWR_CFG_MASK(PwrCfgCmd)))
|
||||
bPollingBit = _TRUE;
|
||||
else
|
||||
rtw_udelay_os(10);
|
||||
udelay(10);
|
||||
|
||||
if (pollingCount++ > maxPollingCnt) {
|
||||
RTW_ERR("HalPwrSeqCmdParsing: Fail to polling Offset[%#x]=%02x\n", offset, value);
|
||||
@ -163,9 +163,9 @@ u8 HalPwrSeqCmdParsing(
|
||||
|
||||
case PWR_CMD_DELAY:
|
||||
if (GET_PWR_CFG_VALUE(PwrCfgCmd) == PWRSEQ_DELAY_US)
|
||||
rtw_udelay_os(GET_PWR_CFG_OFFSET(PwrCfgCmd));
|
||||
udelay(GET_PWR_CFG_OFFSET(PwrCfgCmd));
|
||||
else
|
||||
rtw_udelay_os(GET_PWR_CFG_OFFSET(PwrCfgCmd) * 1000);
|
||||
udelay(GET_PWR_CFG_OFFSET(PwrCfgCmd) * 1000);
|
||||
break;
|
||||
|
||||
case PWR_CMD_END:
|
||||
|
@ -942,7 +942,7 @@ void halbtc8192e2ant_dac_swing(IN struct btc_coexist *btcoexist,
|
||||
coex_dm->cur_dac_swing_lvl))
|
||||
return;
|
||||
}
|
||||
delay_ms(30);
|
||||
mdelay(30);
|
||||
halbtc8192e2ant_set_sw_full_time_dac_swing(btcoexist, dac_swing_on,
|
||||
dac_swing_lvl);
|
||||
|
||||
@ -1562,7 +1562,7 @@ void halbtc8192e2ant_ps_tdma(IN struct btc_coexist *btcoexist,
|
||||
break;
|
||||
case 1: /* ANT2BT, 0x778=3 */
|
||||
halbtc8192e2ant_set_fw_pstdma(btcoexist, 0x0, 0x0, 0x0, 0x8, 0x0);
|
||||
delay_ms(5);
|
||||
mdelay(5);
|
||||
halbtc8192e2ant_set_ant_path(btcoexist, BTC_ANT_PATH_BT, false, false);
|
||||
break;
|
||||
}
|
||||
|
@ -29,8 +29,6 @@
|
||||
|
||||
#define DCMD_Printf DBG_BT_INFO
|
||||
|
||||
#define delay_ms(ms) rtw_mdelay_os(ms)
|
||||
|
||||
#ifdef bEnable
|
||||
#undef bEnable
|
||||
#endif
|
||||
|
@ -2388,8 +2388,6 @@ u8 halbtcoutsrc_GetAntDetValFromBt(void *pBtcContext)
|
||||
|
||||
status = NDBG_GetAntDetValFromBt(Adapter, opcodeVer, &AntDetVal);
|
||||
|
||||
RT_TRACE(COMP_DBG, DBG_LOUD, ("$$$ halbtcoutsrc_GetAntDetValFromBt(): status = %d, feature = %x\n", status, AntDetVal));
|
||||
|
||||
return AntDetVal;
|
||||
#else
|
||||
return 0;
|
||||
|
@ -4696,7 +4696,7 @@ void rtw_dump_rsvd_page(void *sel, _adapter *adapter, u8 page_offset, u8 page_nu
|
||||
rtw_hal_get_def_var(adapter, HAL_DEF_TX_PAGE_SIZE, &page_size);
|
||||
if (page_size) {
|
||||
buf_size = page_size * page_num;
|
||||
buffer = rtw_zvmalloc(buf_size);
|
||||
buffer = vzalloc(buf_size);
|
||||
|
||||
if (buffer) {
|
||||
rtw_hal_get_rsvd_page(adapter, page_offset, page_num, buffer, buf_size);
|
||||
@ -4729,7 +4729,7 @@ void rtw_dump_fifo(void *sel, _adapter *adapter, u8 fifo_sel, u32 fifo_addr, u32
|
||||
|
||||
if (fifo_size) {
|
||||
buff_size = RND4(fifo_size);
|
||||
buffer = rtw_zvmalloc(buff_size);
|
||||
buffer = vzalloc(buff_size);
|
||||
if (buffer == NULL)
|
||||
buff_size = 0;
|
||||
}
|
||||
@ -5190,7 +5190,7 @@ static void rtw_hal_get_aoac_rpt(_adapter *adapter)
|
||||
rtw_hal_get_def_var(adapter, HAL_DEF_TX_PAGE_SIZE, &page_size);
|
||||
buf_size = page_size * page_number;
|
||||
|
||||
buffer = rtw_zvmalloc(buf_size);
|
||||
buffer = vzalloc(buf_size);
|
||||
|
||||
if (buffer == NULL) {
|
||||
RTW_ERR("%s buffer allocate failed size(%d)\n",
|
||||
@ -8770,7 +8770,7 @@ static void rtw_hal_gate_bb(_adapter *adapter, bool stop)
|
||||
} else {
|
||||
RTW_WARN("%s: MGQ_CPU is busy(%d)!\n",
|
||||
__func__, i);
|
||||
rtw_mdelay_os(10);
|
||||
mdelay(10);
|
||||
}
|
||||
}
|
||||
|
||||
@ -9016,7 +9016,7 @@ bool rtw_read_from_frame_mask(_adapter *adapter, u8 idx)
|
||||
|
||||
do {
|
||||
tmp = rtw_read8(adapter, REG_RXPKTBUF_CTRL);
|
||||
rtw_udelay_os(2);
|
||||
udelay(2);
|
||||
count++;
|
||||
} while (!tmp && count < 100);
|
||||
|
||||
@ -9127,7 +9127,7 @@ bool rtw_write_to_frame_mask(_adapter *adapter, u8 idx,
|
||||
count = 0;
|
||||
do {
|
||||
tmp = rtw_read8(adapter, REG_RXPKTBUF_CTRL);
|
||||
rtw_udelay_os(2);
|
||||
udelay(2);
|
||||
count++;
|
||||
} while (tmp && count < 100);
|
||||
|
||||
|
@ -4092,7 +4092,7 @@ phy_ConfigMACWithParaFile(
|
||||
rlen = rtw_retrieve_from_file(rtw_phy_para_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN);
|
||||
if (rlen > 0) {
|
||||
rtStatus = _SUCCESS;
|
||||
pHalData->mac_reg = rtw_zvmalloc(rlen);
|
||||
pHalData->mac_reg = vzalloc(rlen);
|
||||
if (pHalData->mac_reg) {
|
||||
_rtw_memcpy(pHalData->mac_reg, pHalData->para_file_buf, rlen);
|
||||
pHalData->mac_reg_len = rlen;
|
||||
@ -4171,7 +4171,7 @@ phy_ConfigBBWithParaFile(
|
||||
rlen = rtw_retrieve_from_file(rtw_phy_para_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN);
|
||||
if (rlen > 0) {
|
||||
rtStatus = _SUCCESS;
|
||||
pBuf = rtw_zvmalloc(rlen);
|
||||
pBuf = vzalloc(rlen);
|
||||
if (pBuf) {
|
||||
_rtw_memcpy(pBuf, pHalData->para_file_buf, rlen);
|
||||
*pBufLen = rlen;
|
||||
@ -4209,18 +4209,18 @@ phy_ConfigBBWithParaFile(
|
||||
#ifdef CONFIG_LONG_DELAY_ISSUE
|
||||
msleep(50);
|
||||
#else
|
||||
rtw_mdelay_os(50);
|
||||
mdelay(50);
|
||||
#endif
|
||||
} else if (u4bRegOffset == 0xfd)
|
||||
rtw_mdelay_os(5);
|
||||
mdelay(5);
|
||||
else if (u4bRegOffset == 0xfc)
|
||||
rtw_mdelay_os(1);
|
||||
mdelay(1);
|
||||
else if (u4bRegOffset == 0xfb)
|
||||
rtw_udelay_os(50);
|
||||
udelay(50);
|
||||
else if (u4bRegOffset == 0xfa)
|
||||
rtw_udelay_os(5);
|
||||
udelay(5);
|
||||
else if (u4bRegOffset == 0xf9)
|
||||
rtw_udelay_os(1);
|
||||
udelay(1);
|
||||
|
||||
/* Get 2nd hex value as register value. */
|
||||
szLine += u4bMove;
|
||||
@ -4232,7 +4232,7 @@ phy_ConfigBBWithParaFile(
|
||||
pHalData->odmpriv.rf_calibrate_info.rega24 = u4bRegValue;
|
||||
|
||||
/* Add 1us delay between BB/RF register setting. */
|
||||
rtw_udelay_os(1);
|
||||
udelay(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4477,7 +4477,7 @@ phy_ConfigBBWithPgParaFile(
|
||||
rlen = rtw_retrieve_from_file(rtw_phy_para_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN);
|
||||
if (rlen > 0) {
|
||||
rtStatus = _SUCCESS;
|
||||
pHalData->bb_phy_reg_pg = rtw_zvmalloc(rlen);
|
||||
pHalData->bb_phy_reg_pg = vzalloc(rlen);
|
||||
if (pHalData->bb_phy_reg_pg) {
|
||||
_rtw_memcpy(pHalData->bb_phy_reg_pg, pHalData->para_file_buf, rlen);
|
||||
pHalData->bb_phy_reg_pg_len = rlen;
|
||||
@ -4526,7 +4526,7 @@ phy_ConfigBBWithMpParaFile(
|
||||
rlen = rtw_retrieve_from_file(rtw_phy_para_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN);
|
||||
if (rlen > 0) {
|
||||
rtStatus = _SUCCESS;
|
||||
pHalData->bb_phy_reg_mp = rtw_zvmalloc(rlen);
|
||||
pHalData->bb_phy_reg_mp = vzalloc(rlen);
|
||||
if (pHalData->bb_phy_reg_mp) {
|
||||
_rtw_memcpy(pHalData->bb_phy_reg_mp, pHalData->para_file_buf, rlen);
|
||||
pHalData->bb_phy_reg_mp_len = rlen;
|
||||
@ -4557,18 +4557,18 @@ phy_ConfigBBWithMpParaFile(
|
||||
#ifdef CONFIG_LONG_DELAY_ISSUE
|
||||
msleep(50);
|
||||
#else
|
||||
rtw_mdelay_os(50);
|
||||
mdelay(50);
|
||||
#endif
|
||||
} else if (u4bRegOffset == 0xfd)
|
||||
rtw_mdelay_os(5);
|
||||
mdelay(5);
|
||||
else if (u4bRegOffset == 0xfc)
|
||||
rtw_mdelay_os(1);
|
||||
mdelay(1);
|
||||
else if (u4bRegOffset == 0xfb)
|
||||
rtw_udelay_os(50);
|
||||
udelay(50);
|
||||
else if (u4bRegOffset == 0xfa)
|
||||
rtw_udelay_os(5);
|
||||
udelay(5);
|
||||
else if (u4bRegOffset == 0xf9)
|
||||
rtw_udelay_os(1);
|
||||
udelay(1);
|
||||
|
||||
/* Get 2nd hex value as register value. */
|
||||
szLine += u4bMove;
|
||||
@ -4577,7 +4577,7 @@ phy_ConfigBBWithMpParaFile(
|
||||
phy_set_bb_reg(Adapter, u4bRegOffset, bMaskDWord, u4bRegValue);
|
||||
|
||||
/* Add 1us delay between BB/RF register setting. */
|
||||
rtw_udelay_os(1);
|
||||
udelay(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4630,7 +4630,7 @@ PHY_ConfigRFWithParaFile(
|
||||
rlen = rtw_retrieve_from_file(rtw_phy_para_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN);
|
||||
if (rlen > 0) {
|
||||
rtStatus = _SUCCESS;
|
||||
pBuf = rtw_zvmalloc(rlen);
|
||||
pBuf = vzalloc(rlen);
|
||||
if (pBuf) {
|
||||
_rtw_memcpy(pBuf, pHalData->para_file_buf, rlen);
|
||||
*pBufLen = rlen;
|
||||
@ -4671,22 +4671,22 @@ PHY_ConfigRFWithParaFile(
|
||||
#ifdef CONFIG_LONG_DELAY_ISSUE
|
||||
msleep(50);
|
||||
#else
|
||||
rtw_mdelay_os(50);
|
||||
mdelay(50);
|
||||
#endif
|
||||
} else if (u4bRegOffset == 0xfd) {
|
||||
/* delay_ms(5); */
|
||||
/* mdelay(5); */
|
||||
for (i = 0; i < 100; i++)
|
||||
rtw_udelay_os(MAX_STALL_TIME);
|
||||
udelay(MAX_STALL_TIME);
|
||||
} else if (u4bRegOffset == 0xfc) {
|
||||
/* delay_ms(1); */
|
||||
/* mdelay(1); */
|
||||
for (i = 0; i < 20; i++)
|
||||
rtw_udelay_os(MAX_STALL_TIME);
|
||||
udelay(MAX_STALL_TIME);
|
||||
} else if (u4bRegOffset == 0xfb)
|
||||
rtw_udelay_os(50);
|
||||
udelay(50);
|
||||
else if (u4bRegOffset == 0xfa)
|
||||
rtw_udelay_os(5);
|
||||
udelay(5);
|
||||
else if (u4bRegOffset == 0xf9)
|
||||
rtw_udelay_os(1);
|
||||
udelay(1);
|
||||
else if (u4bRegOffset == 0xffff)
|
||||
break;
|
||||
|
||||
@ -4703,7 +4703,7 @@ PHY_ConfigRFWithParaFile(
|
||||
/* 0x2b 0x00808 frequency divider. */
|
||||
/* 0x2b 0x53333 */
|
||||
/* 0x2c 0x0000c */
|
||||
rtw_udelay_os(1);
|
||||
udelay(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4829,7 +4829,7 @@ PHY_ConfigRFWithTxPwrTrackParaFile(
|
||||
rlen = rtw_retrieve_from_file(rtw_phy_para_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN);
|
||||
if (rlen > 0) {
|
||||
rtStatus = _SUCCESS;
|
||||
pHalData->rf_tx_pwr_track = rtw_zvmalloc(rlen);
|
||||
pHalData->rf_tx_pwr_track = vzalloc(rlen);
|
||||
if (pHalData->rf_tx_pwr_track) {
|
||||
_rtw_memcpy(pHalData->rf_tx_pwr_track, pHalData->para_file_buf, rlen);
|
||||
pHalData->rf_tx_pwr_track_len = rlen;
|
||||
@ -5328,7 +5328,7 @@ PHY_ConfigRFWithPowerLimitTableParaFile(
|
||||
rlen = rtw_retrieve_from_file(rtw_phy_para_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN);
|
||||
if (rlen > 0) {
|
||||
rtStatus = _SUCCESS;
|
||||
pHalData->rf_tx_pwr_lmt = rtw_zvmalloc(rlen);
|
||||
pHalData->rf_tx_pwr_lmt = vzalloc(rlen);
|
||||
if (pHalData->rf_tx_pwr_lmt) {
|
||||
_rtw_memcpy(pHalData->rf_tx_pwr_lmt, pHalData->para_file_buf, rlen);
|
||||
pHalData->rf_tx_pwr_lmt_len = rlen;
|
||||
|
@ -410,7 +410,7 @@ static void _halmac_udelay(void *p, u32 us)
|
||||
{
|
||||
/* Most hardware polling wait time < 50us) */
|
||||
if (us <= 50)
|
||||
rtw_udelay_os(us);
|
||||
udelay(us);
|
||||
else if (us <= 1000)
|
||||
rtw_usleep_os(us);
|
||||
else
|
||||
@ -4388,7 +4388,7 @@ int rtw_halmac_dump_fifo(struct dvobj_priv *d, u8 fifo_sel, u32 addr, u32 size,
|
||||
fifo_size = api->halmac_get_fifo_size(mac, halmac_fifo_sel);
|
||||
|
||||
if (fifo_size)
|
||||
pfifo_map = rtw_zvmalloc(fifo_size);
|
||||
pfifo_map = vzalloc(fifo_size);
|
||||
if (pfifo_map == NULL)
|
||||
return -1;
|
||||
mem_created = _TRUE;
|
||||
|
@ -319,29 +319,17 @@ int usb_async_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val)
|
||||
|
||||
u8 usb_read8(struct intf_hdl *pintfhdl, u32 addr)
|
||||
{
|
||||
u8 request;
|
||||
u8 requesttype;
|
||||
u16 wvalue;
|
||||
u16 index;
|
||||
u16 len;
|
||||
u16 wvalue = (u16)(addr & 0x0000ffff);
|
||||
u8 data = 0;
|
||||
|
||||
|
||||
request = 0x05;
|
||||
requesttype = 0x01;/* read_in */
|
||||
index = 0;/* n/a */
|
||||
|
||||
wvalue = (u16)(addr & 0x0000ffff);
|
||||
len = 1;
|
||||
|
||||
/* WLANON PAGE0_REG needs to add an offset 0x8000 */
|
||||
#if defined(CONFIG_RTL8710B)
|
||||
if(wvalue >= 0x0000 && wvalue < 0x0100)
|
||||
wvalue |= 0x8000;
|
||||
#endif
|
||||
|
||||
usbctrl_vendorreq(pintfhdl, request, wvalue, index,
|
||||
&data, len, requesttype);
|
||||
usbctrl_vendorreq(pintfhdl, wvalue, 0, &data, 1, VENDOR_READ);
|
||||
|
||||
|
||||
return data;
|
||||
@ -349,20 +337,8 @@ u8 usb_read8(struct intf_hdl *pintfhdl, u32 addr)
|
||||
|
||||
u16 usb_read16(struct intf_hdl *pintfhdl, u32 addr)
|
||||
{
|
||||
u8 request;
|
||||
u8 requesttype;
|
||||
u16 wvalue;
|
||||
u16 index;
|
||||
u16 len;
|
||||
u16 data = 0;
|
||||
|
||||
|
||||
request = 0x05;
|
||||
requesttype = 0x01;/* read_in */
|
||||
index = 0;/* n/a */
|
||||
|
||||
wvalue = (u16)(addr & 0x0000ffff);
|
||||
len = 2;
|
||||
u16 wvalue = (u16)(addr & 0x0000ffff);
|
||||
u16 data;
|
||||
|
||||
/* WLANON PAGE0_REG needs to add an offset 0x8000 */
|
||||
#if defined(CONFIG_RTL8710B)
|
||||
@ -370,8 +346,7 @@ u16 usb_read16(struct intf_hdl *pintfhdl, u32 addr)
|
||||
wvalue |= 0x8000;
|
||||
#endif
|
||||
|
||||
usbctrl_vendorreq(pintfhdl, request, wvalue, index,
|
||||
&data, len, requesttype);
|
||||
usbctrl_vendorreq(pintfhdl, wvalue, 0, &data, 2, VENDOR_READ);
|
||||
|
||||
|
||||
return data;
|
||||
@ -380,20 +355,8 @@ u16 usb_read16(struct intf_hdl *pintfhdl, u32 addr)
|
||||
|
||||
u32 usb_read32(struct intf_hdl *pintfhdl, u32 addr)
|
||||
{
|
||||
u8 request;
|
||||
u8 requesttype;
|
||||
u16 wvalue;
|
||||
u16 index;
|
||||
u16 len;
|
||||
u32 data = 0;
|
||||
|
||||
|
||||
request = 0x05;
|
||||
requesttype = 0x01;/* read_in */
|
||||
index = 0;/* n/a */
|
||||
|
||||
wvalue = (u16)(addr & 0x0000ffff);
|
||||
len = 4;
|
||||
u16 wvalue = (u16)(addr & 0x0000ffff);
|
||||
u32 data;
|
||||
|
||||
/* WLANON PAGE0_REG needs to add an offset 0x8000 */
|
||||
#if defined(CONFIG_RTL8710B)
|
||||
@ -401,8 +364,7 @@ u32 usb_read32(struct intf_hdl *pintfhdl, u32 addr)
|
||||
wvalue |= 0x8000;
|
||||
#endif
|
||||
|
||||
usbctrl_vendorreq(pintfhdl, request, wvalue, index,
|
||||
&data, len, requesttype);
|
||||
usbctrl_vendorreq(pintfhdl, wvalue, 0, &data, 4, VENDOR_READ);
|
||||
|
||||
|
||||
return data;
|
||||
@ -410,22 +372,7 @@ u32 usb_read32(struct intf_hdl *pintfhdl, u32 addr)
|
||||
|
||||
int usb_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val)
|
||||
{
|
||||
u8 request;
|
||||
u8 requesttype;
|
||||
u16 wvalue;
|
||||
u16 index;
|
||||
u16 len;
|
||||
u8 data;
|
||||
int ret;
|
||||
|
||||
|
||||
request = 0x05;
|
||||
requesttype = 0x00;/* write_out */
|
||||
index = 0;/* n/a */
|
||||
|
||||
wvalue = (u16)(addr & 0x0000ffff);
|
||||
len = 1;
|
||||
data = val;
|
||||
u16 wvalue = (u16)(addr & 0x0000ffff);
|
||||
|
||||
/* WLANON PAGE0_REG needs to add an offset 0x8000 */
|
||||
#if defined(CONFIG_RTL8710B)
|
||||
@ -433,31 +380,13 @@ int usb_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val)
|
||||
wvalue |= 0x8000;
|
||||
#endif
|
||||
|
||||
ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index,
|
||||
&data, len, requesttype);
|
||||
return usbctrl_vendorreq(pintfhdl, wvalue, 0, &val, 1, VENDOR_WRITE);
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int usb_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val)
|
||||
{
|
||||
u8 request;
|
||||
u8 requesttype;
|
||||
u16 wvalue;
|
||||
u16 index;
|
||||
u16 len;
|
||||
u16 data;
|
||||
int ret;
|
||||
|
||||
|
||||
request = 0x05;
|
||||
requesttype = 0x00;/* write_out */
|
||||
index = 0;/* n/a */
|
||||
|
||||
wvalue = (u16)(addr & 0x0000ffff);
|
||||
len = 2;
|
||||
data = val;
|
||||
u16 wvalue = (u16)(addr & 0x0000ffff);
|
||||
|
||||
/* WLANON PAGE0_REG needs to add an offset 0x8000 */
|
||||
#if defined(CONFIG_RTL8710B)
|
||||
@ -465,32 +394,13 @@ int usb_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val)
|
||||
wvalue |= 0x8000;
|
||||
#endif
|
||||
|
||||
ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index,
|
||||
&data, len, requesttype);
|
||||
|
||||
|
||||
return ret;
|
||||
return usbctrl_vendorreq(pintfhdl, wvalue, 0, &val, 2, VENDOR_WRITE);
|
||||
|
||||
}
|
||||
|
||||
int usb_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val)
|
||||
{
|
||||
u8 request;
|
||||
u8 requesttype;
|
||||
u16 wvalue;
|
||||
u16 index;
|
||||
u16 len;
|
||||
u32 data;
|
||||
int ret;
|
||||
|
||||
|
||||
request = 0x05;
|
||||
requesttype = 0x00;/* write_out */
|
||||
index = 0;/* n/a */
|
||||
|
||||
wvalue = (u16)(addr & 0x0000ffff);
|
||||
len = 4;
|
||||
data = val;
|
||||
u16 wvalue = (u16)(addr & 0x0000ffff);
|
||||
|
||||
/* WLANON PAGE0_REG needs to add an offset 0x8000 */
|
||||
#if defined(CONFIG_RTL8710B)
|
||||
@ -498,37 +408,21 @@ int usb_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val)
|
||||
wvalue |= 0x8000;
|
||||
#endif
|
||||
|
||||
ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index,
|
||||
&data, len, requesttype);
|
||||
|
||||
|
||||
return ret;
|
||||
return usbctrl_vendorreq(pintfhdl, wvalue, 0, &val, 4, VENDOR_WRITE);
|
||||
|
||||
}
|
||||
|
||||
int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata)
|
||||
{
|
||||
u8 request;
|
||||
u8 requesttype;
|
||||
u16 wvalue;
|
||||
u16 index;
|
||||
u16 len;
|
||||
u16 wvalue = (u16)(addr & 0x0000ffff);
|
||||
u8 buf[VENDOR_CMD_MAX_DATA_LEN] = {0};
|
||||
int ret;
|
||||
|
||||
if (length > VENDOR_CMD_MAX_DATA_LEN)
|
||||
return -EINVAL;
|
||||
|
||||
request = 0x05;
|
||||
requesttype = 0x00;/* write_out */
|
||||
index = 0;/* n/a */
|
||||
memcpy(buf, pdata, length);
|
||||
return usbctrl_vendorreq(pintfhdl, wvalue, 0, buf, (length & 0xffff), VENDOR_WRITE);
|
||||
|
||||
wvalue = (u16)(addr & 0x0000ffff);
|
||||
len = length;
|
||||
_rtw_memcpy(buf, pdata, len);
|
||||
ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index,
|
||||
buf, len, requesttype);
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void usb_set_intf_ops(_adapter *padapter, struct _io_ops *pops)
|
||||
|
@ -147,7 +147,7 @@ u8 rtw_hal_data_init(_adapter *padapter)
|
||||
{
|
||||
if (is_primary_adapter(padapter)) {
|
||||
padapter->hal_data_sz = sizeof(HAL_DATA_TYPE);
|
||||
padapter->HalData = rtw_zvmalloc(padapter->hal_data_sz);
|
||||
padapter->HalData = vzalloc(padapter->hal_data_sz);
|
||||
if (padapter->HalData == NULL) {
|
||||
RTW_INFO("cant not alloc memory for HAL DATA\n");
|
||||
return _FAIL;
|
||||
@ -739,7 +739,7 @@ void rtw_hal_write_rfreg(_adapter *padapter, enum rf_path eRFPath, u32 RegAddr,
|
||||
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
if (!IS_HARDWARE_TYPE_JAGUAR_AND_JAGUAR2(padapter)) /*For N-Series IC, suggest by Jenyu*/
|
||||
rtw_udelay_os(2);
|
||||
udelay(2);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -2055,7 +2055,7 @@ static VOID mpt_StopOfdmContTx(
|
||||
else
|
||||
phy_set_bb_reg(pAdapter, rOFDM1_LSTF, BIT30 | BIT29 | BIT28, OFDM_ALL_OFF);
|
||||
|
||||
rtw_mdelay_os(10);
|
||||
mdelay(10);
|
||||
|
||||
if (!IS_HARDWARE_TYPE_JAGUAR(pAdapter) && !IS_HARDWARE_TYPE_JAGUAR2(pAdapter)) {
|
||||
phy_set_bb_reg(pAdapter, 0xa14, 0x300, 0x0); /* 0xa15[1:0] = 0*/
|
||||
|
@ -300,7 +300,7 @@ odm_txpowertracking_callback_thermal_meter_92e(
|
||||
reg0x18 = phy_query_rf_reg(priv, RF_PATH_A, 0x18, MASK20BITS, 1);
|
||||
phy_set_rf_reg(priv, RF_PATH_A, 0xB4, BIT(14), 1);
|
||||
phy_set_rf_reg(priv, RF_PATH_A, 0x18, BIT(15), 1);
|
||||
delay_ms(1);
|
||||
mdelay(1);
|
||||
phy_set_rf_reg(priv, RF_PATH_A, 0xB4, BIT(14), 0);
|
||||
phy_set_rf_reg(priv, RF_PATH_A, 0x18, MASK20BITS, reg0x18);
|
||||
RTL_W8(0x522, 0x0);
|
||||
@ -1003,7 +1003,7 @@ odm_txpowertracking_callback_thermal_meter_jaguar_series(
|
||||
reg0x18 = phy_query_rf_reg(priv, RF_PATH_A, 0x18, MASK20BITS, 1);
|
||||
phy_set_rf_reg(priv, RF_PATH_A, 0xB4, BIT(14), 1);
|
||||
phy_set_rf_reg(priv, RF_PATH_A, 0x18, BIT(15), 1);
|
||||
delay_ms(200); /* frequency deviation */
|
||||
mdelay(200); /* frequency deviation */
|
||||
phy_set_rf_reg(priv, RF_PATH_A, 0xB4, BIT(14), 0);
|
||||
phy_set_rf_reg(priv, RF_PATH_A, 0x18, MASK20BITS, reg0x18);
|
||||
#ifdef CONFIG_RTL_8812_SUPPORT
|
||||
|
@ -85,8 +85,6 @@ static __inline void RF_DBG(PDM_ODM_T dm, int comp, char *fmt, ...)
|
||||
do { \
|
||||
struct dm_struct *__dm = dm; \
|
||||
if ((comp) & __dm->rf_table.rf_dbg_comp) { \
|
||||
RT_TRACE(((struct rtl_priv *)__dm->adapter), \
|
||||
COMP_PHYDM, DBG_DMESG, "[RF] " fmt, ##args); \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
@ -848,8 +848,6 @@ void odm_txpowertracking_check_mp(void *dm_void)
|
||||
void *adapter = dm->adapter;
|
||||
|
||||
if (odm_check_power_status(adapter) == false) {
|
||||
RT_TRACE(COMP_POWER_TRACKING, DBG_LOUD,
|
||||
("check_pow_status, return false\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -718,7 +718,6 @@ odm_txpowertracking_check_mp(
|
||||
void *adapter = dm->adapter;
|
||||
|
||||
if (odm_check_power_status(adapter) == false) {
|
||||
RT_TRACE(COMP_POWER_TRACKING, DBG_LOUD, ("check_pow_status, return false\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -784,7 +784,6 @@ odm_txpowertracking_check_mp(
|
||||
return;
|
||||
|
||||
if (odm_check_power_status(dm) == false) {
|
||||
RT_TRACE(COMP_POWER_TRACKING, DBG_LOUD, ("check_pow_status return false\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -831,11 +830,8 @@ odm_txpowertracking_thermal_meter_check(
|
||||
struct dm_struct *dm = &(pHalData->DM_OutSrc);
|
||||
struct _hal_rf_ *rf = &(dm->rf_table);
|
||||
|
||||
if (!(rf->rf_supportability & HAL_RF_TX_PWR_TRACK)) {
|
||||
RT_TRACE(COMP_POWER_TRACKING, DBG_LOUD,
|
||||
("===>odm_txpowertracking_thermal_meter_check(),mgnt_info->is_txpowertracking is false, return!!\n"));
|
||||
if (!(rf->rf_supportability & HAL_RF_TX_PWR_TRACK))
|
||||
return;
|
||||
}
|
||||
|
||||
if (!tm_trigger) {
|
||||
if (IS_HARDWARE_TYPE_8188E(adapter) || IS_HARDWARE_TYPE_JAGUAR(adapter) || IS_HARDWARE_TYPE_8192E(adapter) || IS_HARDWARE_TYPE_8192F(adapter)
|
||||
@ -845,14 +841,11 @@ odm_txpowertracking_thermal_meter_check(
|
||||
else
|
||||
PHY_SetRFReg(adapter, RF_PATH_A, RF_T_METER, RFREGOFFSETMASK, 0x60);
|
||||
|
||||
RT_TRACE(COMP_POWER_TRACKING, DBG_LOUD, ("Trigger Thermal Meter!!\n"));
|
||||
|
||||
tm_trigger = 1;
|
||||
return;
|
||||
} else if (IS_HARDWARE_TYPE_8822C(adapter) || IS_HARDWARE_TYPE_8814B(adapter))
|
||||
return;
|
||||
else {
|
||||
RT_TRACE(COMP_POWER_TRACKING, DBG_LOUD, ("Schedule TxPowerTracking direct call!!\n"));
|
||||
odm_txpowertracking_direct_call(adapter);
|
||||
tm_trigger = 0;
|
||||
}
|
||||
|
@ -90,8 +90,6 @@
|
||||
#define pr_debug printk
|
||||
#define RT_PRINTK(fmt, args...) pr_debug(fmt, ## args)
|
||||
#define RT_DISP(dbgtype, dbgflag, printstr)
|
||||
#define RT_TRACE(adapter, comp, drv_level, fmt, args...) \
|
||||
RTW_INFO(fmt, ## args)
|
||||
#define PHYDM_SNPRINTF snprintf
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_IOT)
|
||||
#define pr_debug(fmt, args...) RTW_PRINT_MSG(fmt, ## args)
|
||||
@ -250,9 +248,6 @@ static __inline void PHYDM_DBG_F(PDM_ODM_T dm, int comp, char *fmt, ...)
|
||||
do { \
|
||||
struct dm_struct *__dm = (dm); \
|
||||
if ((comp) & __dm->debug_components) { \
|
||||
RT_TRACE(((struct rtl_priv *)__dm->adapter),\
|
||||
COMP_PHYDM, DBG_DMESG, \
|
||||
"[PHYDM] " fmt, ##args); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
@ -260,8 +255,6 @@ static __inline void PHYDM_DBG_F(PDM_ODM_T dm, int comp, char *fmt, ...)
|
||||
do { \
|
||||
struct dm_struct *__dm = (dm); \
|
||||
if ((comp) & __dm->debug_components) { \
|
||||
RT_TRACE(((struct rtl_priv *)__dm->adapter),\
|
||||
COMP_PHYDM, DBG_DMESG, fmt, ##args); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
@ -269,9 +262,6 @@ static __inline void PHYDM_DBG_F(PDM_ODM_T dm, int comp, char *fmt, ...)
|
||||
do { \
|
||||
struct dm_struct *__dm = (dm); \
|
||||
if ((comp) & __dm->debug_components) { \
|
||||
RT_TRACE(((struct rtl_priv *)__dm->adapter),\
|
||||
COMP_PHYDM, DBG_DMESG, \
|
||||
"[PHYDM] " title_str "%pM\n", addr);\
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
@ -379,9 +369,7 @@ static __inline void PDM_SNPF(u32 out_len, u32 used, char *buff, int len,
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) && defined(DM_ODM_CE_MAC80211_V2)
|
||||
#define PDM_VAST_SNPF(out_len, used, buff, len, fmt, args...)
|
||||
#else
|
||||
#define PDM_VAST_SNPF(out_len, used, buff, len, fmt, args...) \
|
||||
RT_TRACE(((struct rtl_priv *)dm->adapter), COMP_PHYDM, \
|
||||
DBG_DMESG, fmt, ##args)
|
||||
#define PDM_VAST_SNPF(out_len, used, buff, len, fmt, args...)
|
||||
#endif
|
||||
|
||||
#if (PHYDM_DBGPRINT == 1)
|
||||
|
@ -2315,7 +2315,6 @@ void phydm_dfs_ap_reset_radar_detect_counter_and_flag(void *dm_void)
|
||||
odm_set_bb_reg(dm, R_0xa40, BIT(15), 0);
|
||||
odm_set_bb_reg(dm, R_0xa40, BIT(15), 1);
|
||||
|
||||
/* RT_TRACE(COMP_DFS, DBG_LOUD, ("[DFS], After reset radar counter, 0xcf8 = 0x%x, 0xcf4 = 0x%x\n", */
|
||||
/* PHY_QueryBBReg(Adapter, 0xcf8, bMaskDWord), */
|
||||
/* PHY_QueryBBReg(Adapter, 0xcf4, bMaskDWord))); */
|
||||
}
|
||||
|
@ -370,12 +370,12 @@ void odm_allocate_memory(struct dm_struct *dm, void **ptr, u32 length)
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && defined(DM_ODM_CE_MAC80211_V2)
|
||||
*ptr = kmalloc(length, GFP_ATOMIC);
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
*ptr = rtw_zvmalloc(length);
|
||||
*ptr = vzalloc(length);
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
void *adapter = dm->adapter;
|
||||
PlatformAllocateMemory(adapter, ptr, length);
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_IOT)
|
||||
*ptr = rtw_zvmalloc(length);
|
||||
*ptr = vzalloc(length);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -592,17 +592,17 @@ odm_is_work_item_scheduled(
|
||||
void ODM_delay_ms(u32 ms)
|
||||
{
|
||||
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP))
|
||||
delay_ms(ms);
|
||||
mdelay(ms);
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && defined(DM_ODM_CE_MAC80211)
|
||||
mdelay(ms);
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && defined(DM_ODM_CE_MAC80211_V2)
|
||||
mdelay(ms);
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
rtw_mdelay_os(ms);
|
||||
mdelay(ms);
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
delay_ms(ms);
|
||||
mdelay(ms);
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_IOT)
|
||||
rtw_mdelay_os(ms);
|
||||
mdelay(ms);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -615,18 +615,18 @@ void ODM_delay_us(u32 us)
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && defined(DM_ODM_CE_MAC80211_V2)
|
||||
udelay(us);
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
rtw_udelay_os(us);
|
||||
udelay(us);
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
PlatformStallExecution(us);
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_IOT)
|
||||
rtw_udelay_os(us);
|
||||
udelay(us);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ODM_sleep_ms(u32 ms)
|
||||
{
|
||||
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP))
|
||||
delay_ms(ms);
|
||||
mdelay(ms);
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && defined(DM_ODM_CE_MAC80211)
|
||||
msleep(ms);
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && defined(DM_ODM_CE_MAC80211_V2)
|
||||
@ -634,7 +634,7 @@ void ODM_sleep_ms(u32 ms)
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
msleep(ms);
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
delay_ms(ms);
|
||||
mdelay(ms);
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_IOT)
|
||||
msleep(ms);
|
||||
#endif
|
||||
@ -1023,7 +1023,6 @@ u8 phydm_c2H_content_parsing(void *dm_void, u8 c2h_cmd_id, u8 c2h_cmd_len,
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
|
||||
if (dm->support_ic_type & (ODM_RTL8812 | ODM_RTL8821)) {
|
||||
RT_TRACE(COMP_MP, DBG_LOUD, ("== FW IQK Finish ==\n"));
|
||||
odm_acquire_spin_lock(dm, RT_IQK_SPINLOCK);
|
||||
dm->rf_calibrate_info.is_iqk_in_progress = false;
|
||||
odm_release_spin_lock(dm, RT_IQK_SPINLOCK);
|
||||
|
@ -185,7 +185,6 @@ hal_txbf_8822b_download_ndpa(
|
||||
platform_efio_write_1byte(adapter, REG_FWHW_TXQ_CTRL_8814A + 2, tmp_reg422 & (~BIT(6)));
|
||||
|
||||
if (tmp_reg422 & BIT(6)) {
|
||||
RT_TRACE(COMP_INIT, DBG_LOUD, ("SetBeamformDownloadNDPA_8814A(): There is an adapter is sending beacon.\n"));
|
||||
is_send_beacon = true;
|
||||
}
|
||||
|
||||
@ -600,7 +599,7 @@ void hal_txbf_8822b_enter(
|
||||
hal_txbf_8822b_rf_mode(dm, beamforming_info, bfee_idx);
|
||||
#if (SUPPORT_MU_BF == 1)
|
||||
/*Special for plugfest*/
|
||||
delay_ms(50); /* wait for 4-way handshake ending*/
|
||||
mdelay(50); /* wait for 4-way handshake ending*/
|
||||
send_sw_vht_gid_mgnt_frame(dm, p_beamformee_entry->mac_addr, bfee_idx);
|
||||
#endif
|
||||
|
||||
|
@ -54,7 +54,7 @@ void beamforming_gid_paid(
|
||||
|
||||
/* VHT SU PPDU carrying one or more group addressed MPDUs or */
|
||||
/* Transmitting a VHT NDP intended for multiple recipients */
|
||||
if (MacAddr_isBcst(RA) || MacAddr_isMulticast(RA) || tcb->macId == MAC_ID_STATIC_FOR_BROADCAST_MULTICAST) {
|
||||
if (is_broadcast_ether_addr(RA) || MacAddr_isMulticast(RA) || tcb->macId == MAC_ID_STATIC_FOR_BROADCAST_MULTICAST) {
|
||||
tcb->G_ID = 63;
|
||||
tcb->P_AID = 0;
|
||||
} else if (ACTING_AS_AP(adapter)) {
|
||||
|
@ -354,7 +354,7 @@ void rtl8192e_download_rsvd_page(PADAPTER padapter, u8 mstatus)
|
||||
DLBcnCount++;
|
||||
do {
|
||||
yield();
|
||||
/* rtw_mdelay_os(10); */
|
||||
/* mdelay(10); */
|
||||
/* check rsvd page download OK. */
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_BCN_VALID, (u8 *)(&bcn_valid));
|
||||
poll++;
|
||||
|
@ -3867,8 +3867,8 @@ u8 SetHwReg8192E(PADAPTER Adapter, u8 variable, u8 *val)
|
||||
ulCommand = CAM_CONTENT_COUNT * ucIndex + i;
|
||||
ulCommand = ulCommand | CAM_POLLINIG | CAM_WRITE;
|
||||
/* write content 0 is equall to mark invalid */
|
||||
rtw_write32(Adapter, WCAMI, ulContent); /* delay_ms(40); */
|
||||
rtw_write32(Adapter, RWCAM, ulCommand); /* delay_ms(40); */
|
||||
rtw_write32(Adapter, WCAMI, ulContent); /* mdelay(40); */
|
||||
rtw_write32(Adapter, RWCAM, ulCommand); /* mdelay(40); */
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -3994,7 +3994,7 @@ u8 SetHwReg8192E(PADAPTER Adapter, u8 variable, u8 *val)
|
||||
/* RQPN Load 0 */
|
||||
rtw_write16(Adapter, REG_RQPN_NPQ, 0x0);
|
||||
rtw_write32(Adapter, REG_RQPN, 0x80000000);
|
||||
rtw_mdelay_os(10);
|
||||
mdelay(10);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -140,11 +140,11 @@ phy_RFSerialRead(
|
||||
phy_set_bb_reg(Adapter, rFPGA0_XA_HSSIParameter2 | MaskforPhySet, bMaskDWord, tmplong2 & (~bLSSIReadEdge));
|
||||
phy_set_bb_reg(Adapter, rFPGA0_XA_HSSIParameter2 | MaskforPhySet, bMaskDWord, tmplong2 | bLSSIReadEdge);
|
||||
|
||||
rtw_udelay_os(10);/* PlatformStallExecution(10); */
|
||||
udelay(10);/* PlatformStallExecution(10); */
|
||||
|
||||
/* for(i=0;i<2;i++) */
|
||||
/* PlatformStallExecution(MAX_STALL_TIME); */
|
||||
rtw_udelay_os(10);/* PlatformStallExecution(10); */
|
||||
udelay(10);/* PlatformStallExecution(10); */
|
||||
|
||||
if (eRFPath == RF_PATH_A)
|
||||
RfPiEnable = (u1Byte)phy_query_bb_reg(Adapter, rFPGA0_XA_HSSIParameter1 | MaskforPhySet, BIT8);
|
||||
@ -931,7 +931,7 @@ phy_SpurCalibration_8192E(
|
||||
phy_set_bb_reg(Adapter, rFPGA0_PSDFunction, bMaskDWord, 0xfccd);
|
||||
phy_set_bb_reg(Adapter, rFPGA0_PSDFunction, bMaskDWord, 0x40fccd);
|
||||
/* msleep(30); */
|
||||
rtw_mdelay_os(30);
|
||||
mdelay(30);
|
||||
PSDReport = phy_query_bb_reg(Adapter, rFPGA0_PSDReport, bMaskDWord);
|
||||
/* RTW_INFO(" Path A== PSDReport = 0x%x (%d)\n",PSDReport,PSDReport); */
|
||||
if (PSDReport < 0x16)
|
||||
@ -946,7 +946,7 @@ phy_SpurCalibration_8192E(
|
||||
phy_set_bb_reg(Adapter, rFPGA0_PSDFunction, bMaskDWord, 0xfccd);
|
||||
phy_set_bb_reg(Adapter, rFPGA0_PSDFunction, bMaskDWord, 0x40fccd);
|
||||
/* msleep(30); */
|
||||
rtw_mdelay_os(30);
|
||||
mdelay(30);
|
||||
PSDReport = phy_query_bb_reg(Adapter, rFPGA0_PSDReport, bMaskDWord);
|
||||
/* RTW_INFO(" Path B== PSDReport = 0x%x (%d)\n",PSDReport,PSDReport); */
|
||||
if (PSDReport < 0x16)
|
||||
|
@ -94,18 +94,18 @@ phy_RF6052_Config_ParaFile_8192E(
|
||||
|
||||
/*----Set RF_ENV enable----*/
|
||||
phy_set_bb_reg(Adapter, pPhyReg->rfintfe | MaskforPhySet, bRFSI_RFENV << 16, 0x1);
|
||||
rtw_udelay_os(1);/* PlatformStallExecution(1); */
|
||||
udelay(1);/* PlatformStallExecution(1); */
|
||||
|
||||
/*----Set RF_ENV output high----*/
|
||||
phy_set_bb_reg(Adapter, pPhyReg->rfintfo | MaskforPhySet, bRFSI_RFENV, 0x1);
|
||||
rtw_udelay_os(1);/* PlatformStallExecution(1); */
|
||||
udelay(1);/* PlatformStallExecution(1); */
|
||||
|
||||
/* Set bit number of Address and Data for RF register */
|
||||
phy_set_bb_reg(Adapter, pPhyReg->rfHSSIPara2 | MaskforPhySet, b3WireAddressLength, 0x0); /* Set 1 to 4 bits for 8255 */
|
||||
rtw_udelay_os(1);/* PlatformStallExecution(1); */
|
||||
udelay(1);/* PlatformStallExecution(1); */
|
||||
|
||||
phy_set_bb_reg(Adapter, pPhyReg->rfHSSIPara2 | MaskforPhySet, b3WireDataLength, 0x0); /* Set 0 to 12 bits for 8255 */
|
||||
rtw_udelay_os(1);/* PlatformStallExecution(1); */
|
||||
udelay(1);/* PlatformStallExecution(1); */
|
||||
|
||||
/*----Initialize RF fom connfiguration file----*/
|
||||
switch (eRFPath) {
|
||||
|
@ -12,7 +12,6 @@
|
||||
* more details.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define _HCI_OPS_OS_C_
|
||||
|
||||
/* #include <drv_types.h> */
|
||||
#include <rtl8192e_hal.h>
|
||||
|
@ -286,7 +286,6 @@
|
||||
|
||||
/* #define DBG_CMD_QUEUE */
|
||||
/* #define DBG_IO */
|
||||
/* #define DBG_DELAY_OS */
|
||||
/* #define DBG_MEM_ALLOC */
|
||||
/* #define DBG_IOCTL */
|
||||
|
||||
|
@ -106,10 +106,6 @@
|
||||
|
||||
extern int RTW_STATUS_CODE(int error_code);
|
||||
|
||||
#ifndef RTK_DMP_PLATFORM
|
||||
#define CONFIG_USE_VMALLOC
|
||||
#endif
|
||||
|
||||
/* flags used for rtw_mstat_update() */
|
||||
enum mstat_f {
|
||||
/* type: 0x00ff */
|
||||
@ -143,9 +139,6 @@ typedef enum mstat_status {
|
||||
void rtw_mstat_update(const enum mstat_f flags, const MSTAT_STATUS status, u32 sz);
|
||||
void rtw_mstat_dump(void *sel);
|
||||
bool match_mstat_sniff_rules(const enum mstat_f flags, const size_t size);
|
||||
void *dbg_rtw_vmalloc(u32 sz, const enum mstat_f flags, const char *func, const int line);
|
||||
void *dbg_rtw_zvmalloc(u32 sz, const enum mstat_f flags, const char *func, const int line);
|
||||
void dbg_rtw_vmfree(void *pbuf, const enum mstat_f flags, u32 sz, const char *func, const int line);
|
||||
void *dbg_rtw_malloc(u32 sz, const enum mstat_f flags, const char *func, const int line);
|
||||
void *dbg_rtw_zmalloc(u32 sz, const enum mstat_f flags, const char *func, const int line);
|
||||
void dbg_rtw_mfree(void *pbuf, const enum mstat_f flags, u32 sz, const char *func, const int line);
|
||||
@ -167,19 +160,6 @@ void *dbg_rtw_usb_buffer_alloc(struct usb_device *dev, size_t size, dma_addr_t *
|
||||
void dbg_rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dma_addr_t dma, const enum mstat_f flags, const char *func, const int line);
|
||||
#endif /* CONFIG_USB_HCI */
|
||||
|
||||
#ifdef CONFIG_USE_VMALLOC
|
||||
#define rtw_vmalloc(sz) dbg_rtw_vmalloc((sz), MSTAT_TYPE_VIR, __FUNCTION__, __LINE__)
|
||||
#define rtw_zvmalloc(sz) dbg_rtw_zvmalloc((sz), MSTAT_TYPE_VIR, __FUNCTION__, __LINE__)
|
||||
#define rtw_vmalloc_f(sz, mstat_f) dbg_rtw_vmalloc((sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_VIR, __FUNCTION__, __LINE__)
|
||||
#define rtw_zvmalloc_f(sz, mstat_f) dbg_rtw_zvmalloc((sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_VIR, __FUNCTION__, __LINE__)
|
||||
#define rtw_vmfree_f(pbuf, sz, mstat_f) dbg_rtw_vmfree((pbuf), (sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_VIR, __FUNCTION__, __LINE__)
|
||||
#else /* CONFIG_USE_VMALLOC */
|
||||
#define rtw_vmalloc(sz) dbg_rtw_malloc((sz), MSTAT_TYPE_PHY, __FUNCTION__, __LINE__)
|
||||
#define rtw_zvmalloc(sz) dbg_rtw_zmalloc((sz), MSTAT_TYPE_PHY, __FUNCTION__, __LINE__)
|
||||
#define rtw_vmalloc_f(sz, mstat_f) dbg_rtw_malloc((sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_PHY, __FUNCTION__, __LINE__)
|
||||
#define rtw_zvmalloc_f(sz, mstat_f) dbg_rtw_zmalloc((sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_PHY, __FUNCTION__, __LINE__)
|
||||
#define rtw_vmfree_f(pbuf, sz, mstat_f) dbg_rtw_mfree((pbuf), (sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_PHY, __FUNCTION__, __LINE__)
|
||||
#endif /* CONFIG_USE_VMALLOC */
|
||||
#define rtw_malloc(sz) dbg_rtw_malloc((sz), MSTAT_TYPE_PHY, __FUNCTION__, __LINE__)
|
||||
#define rtw_zmalloc(sz) dbg_rtw_zmalloc((sz), MSTAT_TYPE_PHY, __FUNCTION__, __LINE__)
|
||||
#define rtw_mfree(pbuf, sz) dbg_rtw_mfree((pbuf), (sz), MSTAT_TYPE_PHY, __FUNCTION__, __LINE__)
|
||||
@ -214,8 +194,6 @@ void dbg_rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dm
|
||||
#define rtw_mstat_update(flag, status, sz) do {} while (0)
|
||||
#define rtw_mstat_dump(sel) do {} while (0)
|
||||
#define match_mstat_sniff_rules(flags, size) _FALSE
|
||||
void *_rtw_vmalloc(u32 sz);
|
||||
void *_rtw_zvmalloc(u32 sz);
|
||||
void *_rtw_zmalloc(u32 sz);
|
||||
void *_rtw_malloc(u32 sz);
|
||||
void _rtw_mfree(void *pbuf, u32 sz);
|
||||
@ -238,19 +216,6 @@ void *_rtw_usb_buffer_alloc(struct usb_device *dev, size_t size, dma_addr_t *dma
|
||||
void _rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dma_addr_t dma);
|
||||
#endif /* CONFIG_USB_HCI */
|
||||
|
||||
#ifdef CONFIG_USE_VMALLOC
|
||||
#define rtw_vmalloc(sz) _rtw_vmalloc((sz))
|
||||
#define rtw_zvmalloc(sz) _rtw_zvmalloc((sz))
|
||||
#define rtw_vmalloc_f(sz, mstat_f) _rtw_vmalloc((sz))
|
||||
#define rtw_zvmalloc_f(sz, mstat_f) _rtw_zvmalloc((sz))
|
||||
#define rtw_vmfree_f(pbuf, sz, mstat_f) _rtw_vmfree((pbuf), (sz))
|
||||
#else /* CONFIG_USE_VMALLOC */
|
||||
#define rtw_vmalloc(sz) _rtw_malloc((sz))
|
||||
#define rtw_zvmalloc(sz) _rtw_zmalloc((sz))
|
||||
#define rtw_vmalloc_f(sz, mstat_f) _rtw_malloc((sz))
|
||||
#define rtw_zvmalloc_f(sz, mstat_f) _rtw_zmalloc((sz))
|
||||
#define rtw_vmfree_f(pbuf, sz, mstat_f) _rtw_mfree((pbuf), (sz))
|
||||
#endif /* CONFIG_USE_VMALLOC */
|
||||
#define rtw_malloc(sz) _rtw_malloc((sz))
|
||||
#define rtw_zmalloc(sz) _rtw_zmalloc((sz))
|
||||
#define rtw_mfree(pbuf, sz) _rtw_mfree((pbuf), (sz))
|
||||
@ -362,22 +327,10 @@ extern bool _rtw_time_after(systime a, systime b);
|
||||
#define rtw_time_before(a,b) _rtw_time_after(b,a)
|
||||
#endif
|
||||
|
||||
extern void rtw_sleep_schedulable(int ms);
|
||||
|
||||
extern void rtw_usleep_os(int us);
|
||||
|
||||
extern u32 rtw_atoi(u8 *s);
|
||||
|
||||
#ifdef DBG_DELAY_OS
|
||||
#define rtw_mdelay_os(ms) _rtw_mdelay_os((ms), __FUNCTION__, __LINE__)
|
||||
#define rtw_udelay_os(ms) _rtw_udelay_os((ms), __FUNCTION__, __LINE__)
|
||||
extern void _rtw_mdelay_os(int ms, const char *func, const int line);
|
||||
extern void _rtw_udelay_os(int us, const char *func, const int line);
|
||||
#else
|
||||
extern void rtw_mdelay_os(int ms);
|
||||
extern void rtw_udelay_os(int us);
|
||||
#endif
|
||||
|
||||
extern void rtw_init_timer(_timer *ptimer, void *padapter, void *pfunc, void *ctx);
|
||||
|
||||
|
||||
|
@ -792,22 +792,6 @@ __inline static u8 *recvframe_pull_tail(union recv_frame *precvframe, sint sz)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
__inline static _buffer *get_rxbuf_desc(union recv_frame *precvframe)
|
||||
{
|
||||
_buffer *buf_desc;
|
||||
|
||||
if (precvframe == NULL)
|
||||
return NULL;
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
NdisQueryPacket(precvframe->u.hdr.pkt, NULL, NULL, &buf_desc, NULL);
|
||||
#endif
|
||||
|
||||
return buf_desc;
|
||||
}
|
||||
|
||||
|
||||
__inline static union recv_frame *rxmem_to_recvframe(u8 *rxmem)
|
||||
{
|
||||
/* due to the design of 2048 bytes alignment of recv_frame, we can reference the union recv_frame */
|
||||
@ -818,44 +802,6 @@ __inline static union recv_frame *rxmem_to_recvframe(u8 *rxmem)
|
||||
|
||||
}
|
||||
|
||||
__inline static union recv_frame *pkt_to_recvframe(_pkt *pkt)
|
||||
{
|
||||
|
||||
u8 *buf_star;
|
||||
union recv_frame *precv_frame;
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
_buffer *buf_desc;
|
||||
uint len;
|
||||
|
||||
NdisQueryPacket(pkt, NULL, NULL, &buf_desc, &len);
|
||||
NdisQueryBufferSafe(buf_desc, &buf_star, &len, HighPagePriority);
|
||||
#endif
|
||||
precv_frame = rxmem_to_recvframe((unsigned char *)buf_star);
|
||||
|
||||
return precv_frame;
|
||||
}
|
||||
|
||||
__inline static u8 *pkt_to_recvmem(_pkt *pkt)
|
||||
{
|
||||
/* return the rx_head */
|
||||
|
||||
union recv_frame *precv_frame = pkt_to_recvframe(pkt);
|
||||
|
||||
return precv_frame->u.hdr.rx_head;
|
||||
|
||||
}
|
||||
|
||||
__inline static u8 *pkt_to_recvdata(_pkt *pkt)
|
||||
{
|
||||
/* return the rx_data */
|
||||
|
||||
union recv_frame *precv_frame = pkt_to_recvframe(pkt);
|
||||
|
||||
return precv_frame->u.hdr.rx_data;
|
||||
|
||||
}
|
||||
|
||||
|
||||
__inline static sint get_recvframe_len(union recv_frame *precvframe)
|
||||
{
|
||||
return precvframe->u.hdr.len;
|
||||
|
@ -60,7 +60,7 @@ void usb_read_port_cancel(struct intf_hdl *pintfhdl);
|
||||
u32 usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem);
|
||||
void usb_write_port_cancel(struct intf_hdl *pintfhdl);
|
||||
|
||||
int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 index, void *pdata, u16 len, u8 requesttype);
|
||||
int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u16 value, u16 index, void *pdata, u16 len, u8 requesttype);
|
||||
#ifdef CONFIG_USB_SUPPORT_ASYNC_VDN_REQ
|
||||
int _usbctrl_vendorreq_async_write(struct usb_device *udev, u8 request,
|
||||
u16 value, u16 index, void *pdata, u16 len, u8 requesttype);
|
||||
|
@ -441,13 +441,6 @@ enum WIFI_REG_DOMAIN {
|
||||
#define GetAddr4Ptr(pbuf) ((unsigned char *)((SIZE_PTR)(pbuf) + 24))
|
||||
|
||||
|
||||
#define MacAddr_isBcst(addr) \
|
||||
(\
|
||||
((addr[0] == 0xff) && (addr[1] == 0xff) && \
|
||||
(addr[2] == 0xff) && (addr[3] == 0xff) && \
|
||||
(addr[4] == 0xff) && (addr[5] == 0xff)) ? _TRUE : _FALSE \
|
||||
)
|
||||
|
||||
__inline static int IS_MCAST(const u8 *da)
|
||||
{
|
||||
if ((*da) & 0x01)
|
||||
@ -803,11 +796,6 @@ struct rtw_ieee80211_bar {
|
||||
} __attribute__((packed));
|
||||
#endif
|
||||
|
||||
/* 802.11 BAR control masks */
|
||||
#define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000
|
||||
#define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004
|
||||
|
||||
|
||||
#if defined(PLATFORM_LINUX) || defined(CONFIG_RTL8712FW) || defined(PLATFORM_FREEBSD)
|
||||
|
||||
|
||||
@ -981,53 +969,7 @@ typedef enum _HT_CAP_AMPDU_DENSITY {
|
||||
} HT_CAP_AMPDU_DENSITY;
|
||||
|
||||
/* 802.11n HT capabilities masks */
|
||||
#define IEEE80211_HT_CAP_LDPC_CODING 0x0001
|
||||
#define IEEE80211_HT_CAP_SUP_WIDTH 0x0002
|
||||
#define IEEE80211_HT_CAP_SM_PS 0x000C
|
||||
#define IEEE80211_HT_CAP_GRN_FLD 0x0010
|
||||
#define IEEE80211_HT_CAP_SGI_20 0x0020
|
||||
#define IEEE80211_HT_CAP_SGI_40 0x0040
|
||||
#define IEEE80211_HT_CAP_TX_STBC 0x0080
|
||||
#define IEEE80211_HT_CAP_RX_STBC_1R 0x0100
|
||||
#define IEEE80211_HT_CAP_RX_STBC_2R 0x0200
|
||||
#define IEEE80211_HT_CAP_RX_STBC_3R 0x0300
|
||||
#define IEEE80211_HT_CAP_DELAY_BA 0x0400
|
||||
#define IEEE80211_HT_CAP_MAX_AMSDU 0x0800
|
||||
#define IEEE80211_HT_CAP_DSSSCCK40 0x1000
|
||||
#define RTW_IEEE80211_HT_CAP_40MHZ_INTOLERANT ((u16) BIT(14))
|
||||
/* 802.11n HT capability AMPDU settings */
|
||||
#define IEEE80211_HT_CAP_AMPDU_FACTOR 0x03
|
||||
#define IEEE80211_HT_CAP_AMPDU_DENSITY 0x1C
|
||||
/* 802.11n HT capability MSC set */
|
||||
#define IEEE80211_SUPP_MCS_SET_UEQM 4
|
||||
#define IEEE80211_HT_CAP_MAX_STREAMS 4
|
||||
#define IEEE80211_SUPP_MCS_SET_LEN 10
|
||||
/* maximum streams the spec allows */
|
||||
#define IEEE80211_HT_CAP_MCS_TX_DEFINED 0x01
|
||||
#define IEEE80211_HT_CAP_MCS_TX_RX_DIFF 0x02
|
||||
#define IEEE80211_HT_CAP_MCS_TX_STREAMS 0x0C
|
||||
#define IEEE80211_HT_CAP_MCS_TX_UEQM 0x10
|
||||
/* 802.11n HT capability TXBF capability */
|
||||
#define IEEE80211_HT_CAP_TXBF_RX_NDP 0x00000008
|
||||
#define IEEE80211_HT_CAP_TXBF_TX_NDP 0x00000010
|
||||
#define IEEE80211_HT_CAP_TXBF_EXPLICIT_COMP_STEERING_CAP 0x00000400
|
||||
|
||||
/* 802.11n HT IE masks */
|
||||
#define IEEE80211_HT_IE_CHA_SEC_OFFSET 0x03
|
||||
#define IEEE80211_HT_IE_CHA_SEC_NONE 0x00
|
||||
#define IEEE80211_HT_IE_CHA_SEC_ABOVE 0x01
|
||||
#define IEEE80211_HT_IE_CHA_SEC_BELOW 0x03
|
||||
#define IEEE80211_HT_IE_CHA_WIDTH 0x04
|
||||
#define IEEE80211_HT_IE_HT_PROTECTION 0x0003
|
||||
#define IEEE80211_HT_IE_NON_GF_STA_PRSNT 0x0004
|
||||
#define IEEE80211_HT_IE_NON_HT_STA_PRSNT 0x0010
|
||||
|
||||
/* block-ack parameters */
|
||||
#define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002
|
||||
#define IEEE80211_ADDBA_PARAM_TID_MASK 0x003C
|
||||
#define RTW_IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK 0xFFC0
|
||||
#define IEEE80211_DELBA_PARAM_TID_MASK 0xF000
|
||||
#define IEEE80211_DELBA_PARAM_INITIATOR_MASK 0x0800
|
||||
|
||||
/*
|
||||
* A-PMDU buffer sizes
|
||||
|
@ -65,37 +65,6 @@ extern u8 convert_ip_addr(u8 hch, u8 mch, u8 lch);
|
||||
u32 rtw_rates[] = {1000000, 2000000, 5500000, 11000000,
|
||||
6000000, 9000000, 12000000, 18000000, 24000000, 36000000, 48000000, 54000000};
|
||||
|
||||
static const char *const iw_operation_mode[] = {
|
||||
"Auto", "Ad-Hoc", "Managed", "Master", "Repeater", "Secondary", "Monitor"
|
||||
};
|
||||
|
||||
/**
|
||||
* hwaddr_aton - Convert ASCII string to MAC address
|
||||
* @txt: MAC address as a string (e.g., "00:11:22:33:44:55")
|
||||
* @addr: Buffer for the MAC address (ETH_ALEN = 6 bytes)
|
||||
* Returns: 0 on success, -1 on failure (e.g., string not a MAC address)
|
||||
*/
|
||||
static int hwaddr_aton_i(const char *txt, u8 *addr)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
int a, b;
|
||||
|
||||
a = hex2num_i(*txt++);
|
||||
if (a < 0)
|
||||
return -1;
|
||||
b = hex2num_i(*txt++);
|
||||
if (b < 0)
|
||||
return -1;
|
||||
*addr++ = (a << 4) | b;
|
||||
if (i < 5 && *txt++ != ':')
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void indicate_wx_custom_event(_adapter *padapter, char *msg)
|
||||
{
|
||||
u8 *buff;
|
||||
@ -494,7 +463,7 @@ static inline char *iwe_stream_rate_process(_adapter *padapter,
|
||||
ht_cap = _TRUE;
|
||||
pht_capie = (struct rtw_ieee80211_ht_cap *)(p + 2);
|
||||
_rtw_memcpy(&mcs_rate , pht_capie->supp_mcs_set, 2);
|
||||
bw_40MHz = (pht_capie->cap_info & IEEE80211_HT_CAP_SUP_WIDTH) ? 1 : 0;
|
||||
bw_40MHz = (pht_capie->cap_info & IEEE80211_HT_CAP_SUP_WIDTH_20_40) ? 1 : 0;
|
||||
short_GI = (pht_capie->cap_info & (IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_40)) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
@ -3757,8 +3726,7 @@ static int rtw_get_ap_info(struct net_device *dev,
|
||||
|
||||
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
|
||||
|
||||
/* if(hwaddr_aton_i(pdata->pointer, bssid)) */
|
||||
if (hwaddr_aton_i(data, bssid)) {
|
||||
if (!mac_pton(data, bssid)) {
|
||||
RTW_INFO("Invalid BSSID '%s'.\n", (u8 *)data);
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
return -EINVAL;
|
||||
@ -7870,7 +7838,7 @@ static int rtw_wx_set_priv(struct net_device *dev,
|
||||
return -EFAULT;
|
||||
|
||||
len = dwrq->length;
|
||||
ext = rtw_vmalloc(len);
|
||||
ext = vmalloc(len);
|
||||
if (!ext)
|
||||
return -ENOMEM;
|
||||
|
||||
@ -7882,7 +7850,7 @@ static int rtw_wx_set_priv(struct net_device *dev,
|
||||
|
||||
|
||||
#ifdef CONFIG_DEBUG_RTW_WX_SET_PRIV
|
||||
ext_dbg = rtw_vmalloc(len);
|
||||
ext_dbg = vmalloc(len);
|
||||
if (!ext_dbg) {
|
||||
vfree(ext);
|
||||
return -ENOMEM;
|
||||
@ -12023,62 +11991,47 @@ free_buf:
|
||||
}
|
||||
|
||||
static iw_handler rtw_handlers[] = {
|
||||
NULL, /* SIOCSIWCOMMIT */
|
||||
rtw_wx_get_name, /* SIOCGIWNAME */
|
||||
dummy, /* SIOCSIWNWID */
|
||||
dummy, /* SIOCGIWNWID */
|
||||
rtw_wx_set_freq, /* SIOCSIWFREQ */
|
||||
rtw_wx_get_freq, /* SIOCGIWFREQ */
|
||||
rtw_wx_set_mode, /* SIOCSIWMODE */
|
||||
rtw_wx_get_mode, /* SIOCGIWMODE */
|
||||
dummy, /* SIOCSIWSENS */
|
||||
rtw_wx_get_sens, /* SIOCGIWSENS */
|
||||
NULL, /* SIOCSIWRANGE */
|
||||
rtw_wx_get_range, /* SIOCGIWRANGE */
|
||||
rtw_wx_set_priv, /* SIOCSIWPRIV */
|
||||
NULL, /* SIOCGIWPRIV */
|
||||
NULL, /* SIOCSIWSTATS */
|
||||
NULL, /* SIOCGIWSTATS */
|
||||
dummy, /* SIOCSIWSPY */
|
||||
dummy, /* SIOCGIWSPY */
|
||||
NULL, /* SIOCGIWTHRSPY */
|
||||
NULL, /* SIOCWIWTHRSPY */
|
||||
rtw_wx_set_wap, /* SIOCSIWAP */
|
||||
rtw_wx_get_wap, /* SIOCGIWAP */
|
||||
rtw_wx_set_mlme, /* request MLME operation; uses struct iw_mlme */
|
||||
dummy, /* SIOCGIWAPLIST -- depricated */
|
||||
rtw_wx_set_scan, /* SIOCSIWSCAN */
|
||||
rtw_wx_get_scan, /* SIOCGIWSCAN */
|
||||
rtw_wx_set_essid, /* SIOCSIWESSID */
|
||||
rtw_wx_get_essid, /* SIOCGIWESSID */
|
||||
dummy, /* SIOCSIWNICKN */
|
||||
rtw_wx_get_nick, /* SIOCGIWNICKN */
|
||||
NULL, /* -- hole -- */
|
||||
NULL, /* -- hole -- */
|
||||
rtw_wx_set_rate, /* SIOCSIWRATE */
|
||||
rtw_wx_get_rate, /* SIOCGIWRATE */
|
||||
rtw_wx_set_rts, /* SIOCSIWRTS */
|
||||
rtw_wx_get_rts, /* SIOCGIWRTS */
|
||||
rtw_wx_set_frag, /* SIOCSIWFRAG */
|
||||
rtw_wx_get_frag, /* SIOCGIWFRAG */
|
||||
dummy, /* SIOCSIWTXPOW */
|
||||
dummy, /* SIOCGIWTXPOW */
|
||||
dummy, /* SIOCSIWRETRY */
|
||||
rtw_wx_get_retry, /* SIOCGIWRETRY */
|
||||
rtw_wx_set_enc, /* SIOCSIWENCODE */
|
||||
rtw_wx_get_enc, /* SIOCGIWENCODE */
|
||||
dummy, /* SIOCSIWPOWER */
|
||||
rtw_wx_get_power, /* SIOCGIWPOWER */
|
||||
NULL, /*---hole---*/
|
||||
NULL, /*---hole---*/
|
||||
rtw_wx_set_gen_ie, /* SIOCSIWGENIE */
|
||||
NULL, /* SIOCGWGENIE */
|
||||
rtw_wx_set_auth, /* SIOCSIWAUTH */
|
||||
NULL, /* SIOCGIWAUTH */
|
||||
rtw_wx_set_enc_ext, /* SIOCSIWENCODEEXT */
|
||||
NULL, /* SIOCGIWENCODEEXT */
|
||||
rtw_wx_set_pmkid, /* SIOCSIWPMKSA */
|
||||
NULL, /*---hole---*/
|
||||
IW_HANDLER(SIOCGIWNAME, rtw_wx_get_name),
|
||||
IW_HANDLER(SIOCSIWNWID, dummy),
|
||||
IW_HANDLER(SIOCGIWNWID, dummy),
|
||||
IW_HANDLER(SIOCGIWFREQ, rtw_wx_set_freq),
|
||||
IW_HANDLER(SIOCGIWFREQ, rtw_wx_get_freq),
|
||||
IW_HANDLER(SIOCSIWMODE, rtw_wx_set_mode),
|
||||
IW_HANDLER(SIOCGIWMODE, rtw_wx_get_mode),
|
||||
IW_HANDLER(SIOCSIWSENS, dummy),
|
||||
IW_HANDLER(SIOCGIWSENS, rtw_wx_get_sens),
|
||||
IW_HANDLER(SIOCGIWRANGE, rtw_wx_get_range),
|
||||
IW_HANDLER(SIOCSIWPRIV, rtw_wx_set_priv),
|
||||
IW_HANDLER(SIOCSIWSPY, dummy),
|
||||
IW_HANDLER(SIOCGIWSPY, dummy),
|
||||
IW_HANDLER(SIOCSIWAP, rtw_wx_set_wap),
|
||||
IW_HANDLER(SIOCGIWAP, rtw_wx_get_wap),
|
||||
IW_HANDLER(SIOCSIWMLME, rtw_wx_set_mlme),
|
||||
IW_HANDLER(SIOCGIWAPLIST, dummy),
|
||||
IW_HANDLER(SIOCSIWSCAN, rtw_wx_set_scan),
|
||||
IW_HANDLER(SIOCGIWSCAN, rtw_wx_get_scan),
|
||||
IW_HANDLER(SIOCSIWESSID, rtw_wx_set_essid),
|
||||
IW_HANDLER(SIOCGIWESSID, rtw_wx_get_essid),
|
||||
IW_HANDLER(SIOCSIWNICKN, dummy),
|
||||
IW_HANDLER(SIOCGIWNICKN, rtw_wx_get_nick),
|
||||
IW_HANDLER(SIOCSIWRATE, rtw_wx_set_rate),
|
||||
IW_HANDLER(SIOCGIWRATE, rtw_wx_get_rate),
|
||||
IW_HANDLER(SIOCSIWRTS, rtw_wx_set_rts),
|
||||
IW_HANDLER(SIOCGIWRTS, rtw_wx_get_rts),
|
||||
IW_HANDLER(SIOCSIWFRAG, rtw_wx_set_frag),
|
||||
IW_HANDLER(SIOCGIWFRAG, rtw_wx_get_frag),
|
||||
IW_HANDLER(SIOCSIWTXPOW, dummy),
|
||||
IW_HANDLER(SIOCGIWTXPOW, dummy),
|
||||
IW_HANDLER(SIOCSIWRETRY, dummy),
|
||||
IW_HANDLER(SIOCGIWRETRY, rtw_wx_get_retry),
|
||||
IW_HANDLER(SIOCSIWENCODE, rtw_wx_set_enc),
|
||||
IW_HANDLER(SIOCGIWENCODE, rtw_wx_get_enc),
|
||||
IW_HANDLER(SIOCSIWPOWER, dummy),
|
||||
IW_HANDLER(SIOCGIWPOWER, rtw_wx_get_power),
|
||||
IW_HANDLER(SIOCSIWGENIE, rtw_wx_set_gen_ie),
|
||||
IW_HANDLER(SIOCSIWAUTH, rtw_wx_set_auth),
|
||||
IW_HANDLER(SIOCSIWENCODEEXT, rtw_wx_set_enc_ext),
|
||||
IW_HANDLER(SIOCSIWPMKSA, rtw_wx_set_pmkid),
|
||||
};
|
||||
|
||||
|
||||
|
@ -2396,7 +2396,7 @@ u8 rtw_init_drv_sw(_adapter *padapter)
|
||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
_rtw_spinlock_init(&padapter->security_key_mutex);
|
||||
|
||||
/* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */
|
||||
/* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */
|
||||
/* memset((unsigned char *)&padapter->securitypriv, 0, sizeof (struct security_priv)); */
|
||||
|
||||
if (_rtw_init_sta_priv(&padapter->stapriv) == _FAIL) {
|
||||
@ -2805,7 +2805,7 @@ _adapter *rtw_drv_add_vir_if(_adapter *primary_padapter,
|
||||
u8 mac[ETH_ALEN];
|
||||
|
||||
/****** init adapter ******/
|
||||
padapter = (_adapter *)rtw_zvmalloc(sizeof(*padapter));
|
||||
padapter = (_adapter *)vzalloc(sizeof(*padapter));
|
||||
if (padapter == NULL)
|
||||
goto exit;
|
||||
|
||||
|
@ -1186,7 +1186,7 @@ static void shutdown_card(void)
|
||||
break;
|
||||
}
|
||||
|
||||
rtw_mdelay_os(10);
|
||||
mdelay(10);
|
||||
} while (1);
|
||||
|
||||
/* unlock register I/O */
|
||||
|
@ -1270,7 +1270,7 @@ _adapter *rtw_usb_primary_adapter_init(struct dvobj_priv *dvobj,
|
||||
_adapter *padapter = NULL;
|
||||
int status = _FAIL;
|
||||
|
||||
padapter = (_adapter *)rtw_zvmalloc(sizeof(*padapter));
|
||||
padapter = (_adapter *)vzalloc(sizeof(*padapter));
|
||||
if (padapter == NULL)
|
||||
goto exit;
|
||||
|
||||
@ -1471,7 +1471,6 @@ static void rtw_usb_primary_adapter_deinit(_adapter *padapter)
|
||||
static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device_id *pdid)
|
||||
{
|
||||
_adapter *padapter = NULL;
|
||||
int status = _FAIL;
|
||||
struct dvobj_priv *dvobj;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
int i;
|
||||
@ -1484,8 +1483,8 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device
|
||||
|
||||
/* Initialize dvobj_priv */
|
||||
dvobj = usb_dvobj_init(pusb_intf, pdid);
|
||||
if (dvobj == NULL) {
|
||||
goto exit;
|
||||
if (!dvobj) {
|
||||
goto err;
|
||||
}
|
||||
|
||||
padapter = rtw_usb_primary_adapter_init(dvobj, pusb_intf);
|
||||
@ -1534,30 +1533,21 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device
|
||||
#endif
|
||||
|
||||
|
||||
status = _SUCCESS;
|
||||
return 0;
|
||||
|
||||
#if 0 /* not used now */
|
||||
os_ndevs_deinit:
|
||||
if (status != _SUCCESS)
|
||||
rtw_os_ndevs_deinit(dvobj);
|
||||
#endif
|
||||
free_if_vir:
|
||||
if (status != _SUCCESS) {
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
rtw_drv_stop_vir_ifaces(dvobj);
|
||||
rtw_drv_free_vir_ifaces(dvobj);
|
||||
#endif
|
||||
}
|
||||
|
||||
free_if_prim:
|
||||
if (status != _SUCCESS && padapter)
|
||||
rtw_usb_primary_adapter_deinit(padapter);
|
||||
|
||||
free_dvobj:
|
||||
if (status != _SUCCESS)
|
||||
usb_dvobj_deinit(pusb_intf);
|
||||
exit:
|
||||
return status == _SUCCESS ? 0 : -ENODEV;
|
||||
err:
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -23,7 +23,7 @@ struct rtw_async_write_data {
|
||||
struct usb_ctrlrequest dr;
|
||||
};
|
||||
|
||||
int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 index, void *pdata, u16 len, u8 requesttype)
|
||||
int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u16 value, u16 index, void *pdata, u16 len, u8 requesttype)
|
||||
{
|
||||
_adapter *padapter = pintfhdl->padapter;
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
|
||||
@ -106,7 +106,7 @@ int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 inde
|
||||
_rtw_memcpy(pIo_buf, pdata, len);
|
||||
}
|
||||
|
||||
status = usb_control_msg(udev, pipe, request, reqtype, value, index, pIo_buf, len, RTW_USB_CONTROL_MSG_TIMEOUT);
|
||||
status = usb_control_msg(udev, pipe, REALTEK_USB_VENQT_CMD_REQ, reqtype, value, index, pIo_buf, len, RTW_USB_CONTROL_MSG_TIMEOUT);
|
||||
|
||||
if (status == len) { /* Success this control transfer. */
|
||||
rtw_reset_continual_io_error(pdvobjpriv);
|
||||
|
@ -65,52 +65,6 @@ u32 rtw_atoi(u8 *s)
|
||||
|
||||
}
|
||||
|
||||
inline void *_rtw_vmalloc(u32 sz)
|
||||
{
|
||||
void *pbuf;
|
||||
#ifdef PLATFORM_LINUX
|
||||
pbuf = vmalloc(sz);
|
||||
#endif
|
||||
#ifdef PLATFORM_FREEBSD
|
||||
pbuf = malloc(sz, M_DEVBUF, M_NOWAIT);
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
NdisAllocateMemoryWithTag(&pbuf, sz, RT_TAG);
|
||||
#endif
|
||||
|
||||
#ifdef DBG_MEMORY_LEAK
|
||||
#ifdef PLATFORM_LINUX
|
||||
if (pbuf != NULL) {
|
||||
atomic_inc(&_malloc_cnt);
|
||||
atomic_add(sz, &_malloc_size);
|
||||
}
|
||||
#endif
|
||||
#endif /* DBG_MEMORY_LEAK */
|
||||
|
||||
return pbuf;
|
||||
}
|
||||
|
||||
inline void *_rtw_zvmalloc(u32 sz)
|
||||
{
|
||||
void *pbuf;
|
||||
#ifdef PLATFORM_LINUX
|
||||
pbuf = _rtw_vmalloc(sz);
|
||||
if (pbuf != NULL)
|
||||
memset(pbuf, 0, sz);
|
||||
#endif
|
||||
#ifdef PLATFORM_FREEBSD
|
||||
pbuf = malloc(sz, M_DEVBUF, M_ZERO | M_NOWAIT);
|
||||
#endif
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
NdisAllocateMemoryWithTag(&pbuf, sz, RT_TAG);
|
||||
if (pbuf != NULL)
|
||||
NdisFillMemory(pbuf, sz, 0);
|
||||
#endif
|
||||
|
||||
return pbuf;
|
||||
}
|
||||
|
||||
void *_rtw_malloc(u32 sz)
|
||||
{
|
||||
void *pbuf = NULL;
|
||||
@ -540,57 +494,6 @@ bool match_mstat_sniff_rules(const enum mstat_f flags, const size_t size)
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
inline void *dbg_rtw_vmalloc(u32 sz, const enum mstat_f flags, const char *func, const int line)
|
||||
{
|
||||
void *p;
|
||||
|
||||
if (match_mstat_sniff_rules(flags, sz))
|
||||
RTW_INFO("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
|
||||
|
||||
p = _rtw_vmalloc((sz));
|
||||
|
||||
rtw_mstat_update(
|
||||
flags
|
||||
, p ? MSTAT_ALLOC_SUCCESS : MSTAT_ALLOC_FAIL
|
||||
, sz
|
||||
);
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
inline void *dbg_rtw_zvmalloc(u32 sz, const enum mstat_f flags, const char *func, const int line)
|
||||
{
|
||||
void *p;
|
||||
|
||||
if (match_mstat_sniff_rules(flags, sz))
|
||||
RTW_INFO("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
|
||||
|
||||
p = _rtw_zvmalloc((sz));
|
||||
|
||||
rtw_mstat_update(
|
||||
flags
|
||||
, p ? MSTAT_ALLOC_SUCCESS : MSTAT_ALLOC_FAIL
|
||||
, sz
|
||||
);
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
inline void dbg_rtw_vmfree(void *pbuf, u32 sz, const enum mstat_f flags, const char *func, const int line)
|
||||
{
|
||||
|
||||
if (match_mstat_sniff_rules(flags, sz))
|
||||
RTW_INFO("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
|
||||
|
||||
vfree((pbuf));
|
||||
|
||||
rtw_mstat_update(
|
||||
flags
|
||||
, MSTAT_FREE
|
||||
, sz
|
||||
);
|
||||
}
|
||||
|
||||
inline void *dbg_rtw_malloc(u32 sz, const enum mstat_f flags, const char *func, const int line)
|
||||
{
|
||||
void *p;
|
||||
@ -1545,37 +1448,6 @@ inline bool _rtw_time_after(systime a, systime b)
|
||||
#endif
|
||||
}
|
||||
|
||||
void rtw_sleep_schedulable(int ms)
|
||||
{
|
||||
|
||||
#ifdef PLATFORM_LINUX
|
||||
|
||||
u32 delta;
|
||||
|
||||
delta = (ms * HZ) / 1000; /* (ms) */
|
||||
if (delta == 0) {
|
||||
delta = 1;/* 1 ms */
|
||||
}
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
if (schedule_timeout(delta) != 0)
|
||||
return ;
|
||||
return;
|
||||
|
||||
#endif
|
||||
#ifdef PLATFORM_FREEBSD
|
||||
DELAY(ms * 1000);
|
||||
return ;
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
|
||||
NdisMSleep(ms * 1000); /* (us)*1000=(ms) */
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
void rtw_usleep_os(int us)
|
||||
{
|
||||
#ifdef PLATFORM_LINUX
|
||||
@ -1607,100 +1479,6 @@ void rtw_usleep_os(int us)
|
||||
}
|
||||
|
||||
|
||||
#ifdef DBG_DELAY_OS
|
||||
void _rtw_mdelay_os(int ms, const char *func, const int line)
|
||||
{
|
||||
#if 0
|
||||
if (ms > 10)
|
||||
RTW_INFO("%s:%d %s(%d)\n", func, line, __FUNCTION__, ms);
|
||||
msleep(ms);
|
||||
return;
|
||||
#endif
|
||||
|
||||
|
||||
RTW_INFO("%s:%d %s(%d)\n", func, line, __FUNCTION__, ms);
|
||||
|
||||
#if defined(PLATFORM_LINUX)
|
||||
|
||||
mdelay((unsigned long)ms);
|
||||
|
||||
#elif defined(PLATFORM_WINDOWS)
|
||||
|
||||
NdisStallExecution(ms * 1000); /* (us)*1000=(ms) */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
void _rtw_udelay_os(int us, const char *func, const int line)
|
||||
{
|
||||
|
||||
#if 0
|
||||
if (us > 1000) {
|
||||
RTW_INFO("%s:%d %s(%d)\n", func, line, __FUNCTION__, us);
|
||||
rtw_usleep_os(us);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
RTW_INFO("%s:%d %s(%d)\n", func, line, __FUNCTION__, us);
|
||||
|
||||
|
||||
#if defined(PLATFORM_LINUX)
|
||||
|
||||
udelay((unsigned long)us);
|
||||
|
||||
#elif defined(PLATFORM_WINDOWS)
|
||||
|
||||
NdisStallExecution(us); /* (us) */
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
#else
|
||||
void rtw_mdelay_os(int ms)
|
||||
{
|
||||
|
||||
#ifdef PLATFORM_LINUX
|
||||
|
||||
mdelay((unsigned long)ms);
|
||||
|
||||
#endif
|
||||
#ifdef PLATFORM_FREEBSD
|
||||
DELAY(ms * 1000);
|
||||
return ;
|
||||
#endif
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
|
||||
NdisStallExecution(ms * 1000); /* (us)*1000=(ms) */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
void rtw_udelay_os(int us)
|
||||
{
|
||||
|
||||
#ifdef PLATFORM_LINUX
|
||||
|
||||
udelay((unsigned long)us);
|
||||
|
||||
#endif
|
||||
#ifdef PLATFORM_FREEBSD
|
||||
/* Delay for delay microseconds */
|
||||
DELAY(us);
|
||||
return ;
|
||||
#endif
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
|
||||
NdisStallExecution(us); /* (us) */
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
bool rtw_macaddr_is_larger(const u8 *a, const u8 *b)
|
||||
{
|
||||
u32 va, vb;
|
||||
@ -2179,7 +1957,7 @@ struct net_device *rtw_alloc_etherdev(int sizeof_priv)
|
||||
|
||||
pnpi = netdev_priv(pnetdev);
|
||||
|
||||
pnpi->priv = rtw_zvmalloc(sizeof_priv);
|
||||
pnpi->priv = vzalloc(sizeof_priv);
|
||||
if (!pnpi->priv) {
|
||||
free_netdev(pnetdev);
|
||||
pnetdev = NULL;
|
||||
|
@ -41,15 +41,15 @@ int platform_wifi_power_on(void)
|
||||
/* Pull up BT reset pin. */
|
||||
rtw_wifi_gpio_wlan_ctrl(WLAN_BT_PWDN_ON);
|
||||
#endif
|
||||
rtw_mdelay_os(5);
|
||||
mdelay(5);
|
||||
|
||||
sdhci_bus_scan();
|
||||
#ifdef CONFIG_RTL8723B
|
||||
/* YJ,test,130305 */
|
||||
rtw_mdelay_os(1000);
|
||||
mdelay(1000);
|
||||
#endif
|
||||
#ifdef ANDROID_2X
|
||||
rtw_mdelay_os(200);
|
||||
mdelay(200);
|
||||
#else /* !ANDROID_2X */
|
||||
if (1) {
|
||||
int i = 0;
|
||||
@ -70,7 +70,7 @@ void platform_wifi_power_off(void)
|
||||
{
|
||||
/* Pull down pwd pin, make wifi enter power down mode. */
|
||||
rtw_wifi_gpio_wlan_ctrl(WLAN_PWDN_OFF);
|
||||
rtw_mdelay_os(5);
|
||||
mdelay(5);
|
||||
rtw_wifi_gpio_deinit();
|
||||
|
||||
#ifdef CONFIG_RTL8188E
|
||||
|
Loading…
Reference in New Issue
Block a user