rtl8188eu: Fix most sparse warnings other than endedness problems

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2013-06-03 14:52:18 -05:00
parent 925510ff1a
commit 327817d32a
47 changed files with 667 additions and 1771 deletions

View file

@ -46,8 +46,6 @@ void init_mlme_ap_info(_adapter *padapter)
//for ACL
_rtw_init_queue(&pacl_list->acl_node_q);
//pmlmeext->bstart_bss = false;
start_ap_mode(padapter);
}
@ -60,8 +58,6 @@ void free_mlme_ap_info(_adapter *padapter)
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
//stop_ap_mode(padapter);
pmlmepriv->update_bcn = false;
pmlmeext->bstart_bss = false;
@ -78,9 +74,7 @@ void free_mlme_ap_info(_adapter *padapter)
rtw_free_stainfo(padapter, psta);
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
_rtw_spinlock_free(&pmlmepriv->bcn_update_lock);
}
static void update_BCNTIM(_adapter *padapter)
@ -91,12 +85,8 @@ static void update_BCNTIM(_adapter *padapter)
WLAN_BSSID_EX *pnetwork_mlmeext = &(pmlmeinfo->network);
unsigned char *pie = pnetwork_mlmeext->IEs;
//DBG_88E("%s\n", __func__);
//update TIM IE
//if (pstapriv->tim_bitmap)
if (true)
{
if (true) {
u8 *p, *dst_ie, *premainder_ie=NULL, *pbackup_remainder_ie=NULL;
u16 tim_bitmap_le;
uint offset, tmp_len, tim_ielen, tim_ie_offset, remainder_ielen;
@ -104,21 +94,14 @@ static void update_BCNTIM(_adapter *padapter)
tim_bitmap_le = cpu_to_le16(pstapriv->tim_bitmap);
p = rtw_get_ie(pie + _FIXED_IE_LENGTH_, _TIM_IE_, &tim_ielen, pnetwork_mlmeext->IELength - _FIXED_IE_LENGTH_);
if (p != NULL && tim_ielen>0)
{
if (p != NULL && tim_ielen>0) {
tim_ielen += 2;
premainder_ie = p+tim_ielen;
tim_ie_offset = (sint)(p -pie);
remainder_ielen = pnetwork_mlmeext->IELength - tim_ie_offset - tim_ielen;
//append TIM IE from dst_ie offset
dst_ie = p;
}
else
{
} else {
tim_ielen = 0;
//calucate head_len
@ -128,9 +111,7 @@ static void update_BCNTIM(_adapter *padapter)
// get supported rates len
p = rtw_get_ie(pie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_, &tmp_len, (pnetwork_mlmeext->IELength - _BEACON_IE_OFFSET_));
if (p != NULL)
{
offset += tmp_len+2;
}
//DS Parameter Set IE, len=3
offset += 3;
@ -141,19 +122,13 @@ static void update_BCNTIM(_adapter *padapter)
//append TIM IE from offset
dst_ie = pie + offset;
}
if (remainder_ielen>0)
{
if (remainder_ielen > 0) {
pbackup_remainder_ie = rtw_malloc(remainder_ielen);
if (pbackup_remainder_ie && premainder_ie)
_rtw_memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
}
*dst_ie++=_TIM_IE_;
if ((pstapriv->tim_bitmap&0xff00) && (pstapriv->tim_bitmap&0x00fc))
@ -171,27 +146,21 @@ static void update_BCNTIM(_adapter *padapter)
else
*dst_ie++ = 0;
if (tim_ielen==4)
{
if (tim_ielen == 4) {
*dst_ie++ = *(u8*)&tim_bitmap_le;
}
else if (tim_ielen==5)
{
} else if (tim_ielen==5) {
_rtw_memcpy(dst_ie, &tim_bitmap_le, 2);
dst_ie+=2;
}
//copy remainder IE
if (pbackup_remainder_ie)
{
if (pbackup_remainder_ie) {
_rtw_memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen);
rtw_mfree(pbackup_remainder_ie, remainder_ielen);
}
offset = (uint)(dst_ie - pie);
pnetwork_mlmeext->IELength = offset + remainder_ielen;
}
#ifndef CONFIG_INTERRUPT_BASED_TXBCN
@ -199,8 +168,6 @@ static void update_BCNTIM(_adapter *padapter)
set_tx_beacon_cmd(padapter);
#endif
#endif //!CONFIG_INTERRUPT_BASED_TXBCN
}
void rtw_add_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *data, u8 len)
@ -211,29 +178,23 @@ void rtw_add_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *d
u8 *p, *dst_ie, *premainder_ie=NULL, *pbackup_remainder_ie=NULL;
u32 i, offset, ielen, ie_offset, remainder_ielen = 0;
for (i = sizeof(NDIS_802_11_FIXED_IEs); i < pnetwork->IELength;)
{
for (i = sizeof(NDIS_802_11_FIXED_IEs); i < pnetwork->IELength;) {
pIE = (PNDIS_802_11_VARIABLE_IEs)(pnetwork->IEs + i);
if (pIE->ElementID > index)
{
if (pIE->ElementID > index) {
break;
}
else if (pIE->ElementID == index) // already exist the same IE
{
} else if (pIE->ElementID == index) { // already exist the same IE
p = (u8 *)pIE;
ielen = pIE->Length;
bmatch = true;
break;
}
p = (u8 *)pIE;
ielen = pIE->Length;
i += (pIE->Length + 2);
}
if (p != NULL && ielen>0)
{
if (p != NULL && ielen > 0) {
ielen += 2;
premainder_ie = p+ielen;
@ -248,8 +209,7 @@ void rtw_add_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *d
dst_ie = (p+ielen);
}
if (remainder_ielen>0)
{
if (remainder_ielen > 0) {
pbackup_remainder_ie = rtw_malloc(remainder_ielen);
if (pbackup_remainder_ie && premainder_ie)
_rtw_memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
@ -262,8 +222,7 @@ void rtw_add_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *d
dst_ie+=len;
//copy remainder IE
if (pbackup_remainder_ie)
{
if (pbackup_remainder_ie) {
_rtw_memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen);
rtw_mfree(pbackup_remainder_ie, remainder_ielen);
@ -280,8 +239,7 @@ void rtw_remove_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index)
u8 *pie = pnetwork->IEs;
p = rtw_get_ie(pie + _FIXED_IE_LENGTH_, index, &ielen, pnetwork->IELength - _FIXED_IE_LENGTH_);
if (p != NULL && ielen>0)
{
if (p != NULL && ielen > 0) {
ielen += 2;
premainder_ie = p+ielen;
@ -293,16 +251,14 @@ void rtw_remove_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index)
dst_ie = p;
}
if (remainder_ielen>0)
{
if (remainder_ielen > 0) {
pbackup_remainder_ie = rtw_malloc(remainder_ielen);
if (pbackup_remainder_ie && premainder_ie)
_rtw_memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
}
//copy remainder IE
if (pbackup_remainder_ie)
{
if (pbackup_remainder_ie) {
_rtw_memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen);
rtw_mfree(pbackup_remainder_ie, remainder_ielen);
@ -312,31 +268,23 @@ void rtw_remove_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index)
pnetwork->IELength = offset + remainder_ielen;
}
u8 chk_sta_is_alive(struct sta_info *psta);
u8 chk_sta_is_alive(struct sta_info *psta)
static u8 chk_sta_is_alive(struct sta_info *psta)
{
u8 ret = false;
#ifdef DBG_EXPIRATION_CHK
DBG_88E("sta:%pM, rssi:%d, rx:"STA_PKTS_FMT", expire_to:%u, %s%ssq_len:%u\n"
, (psta->hwaddr)
, psta->rssi_stat.UndecoratedSmoothedPWDB
//, STA_RX_PKTS_ARG(psta)
, STA_RX_PKTS_DIFF_ARG(psta)
, psta->expire_to
, psta->state&WIFI_SLEEP_STATE?"PS, ":""
, psta->state&WIFI_STA_ALIVE_CHK_STATE?"SAC, ":""
, psta->sleepq_len
);
DBG_88E("sta:%pM, rssi:%d, rx:"STA_PKTS_FMT", expire_to:%u, %s%ssq_len:%u\n",
(psta->hwaddr), psta->rssi_stat.UndecoratedSmoothedPWDB,
STA_RX_PKTS_DIFF_ARG(psta), psta->expire_to,
psta->state&WIFI_SLEEP_STATE ? "PS, " : "",
psta->state&WIFI_STA_ALIVE_CHK_STATE ? "SAC, " : "",
psta->sleepq_len);
#endif
if ((psta->sta_stats.last_rx_data_pkts + psta->sta_stats.last_rx_ctrl_pkts) == (psta->sta_stats.rx_data_pkts + psta->sta_stats.rx_ctrl_pkts))
{
}
if ((psta->sta_stats.last_rx_data_pkts + psta->sta_stats.last_rx_ctrl_pkts) ==
(psta->sta_stats.rx_data_pkts + psta->sta_stats.rx_ctrl_pkts))
;
else
{
ret = true;
}
sta_update_last_rx_pkts(psta);
@ -366,21 +314,18 @@ void expire_timeout_chk(_adapter *padapter)
, FUNC_NDEV_ARG(padapter->pnetdev), pstapriv->auth_list_cnt);
}
#endif
while ((rtw_end_of_queue_search(phead, plist)) == false)
{
while ((rtw_end_of_queue_search(phead, plist)) == false) {
psta = LIST_CONTAINOR(plist, struct sta_info, auth_list);
plist = get_next(plist);
if (psta->expire_to>0)
{
if (psta->expire_to > 0) {
psta->expire_to--;
if (psta->expire_to == 0)
{
if (psta->expire_to == 0) {
rtw_list_delete(&psta->auth_list);
pstapriv->auth_list_cnt--;
DBG_88E("auth expire %02X%02X%02X%02X%02X%02X\n",
psta->hwaddr[0],psta->hwaddr[1],psta->hwaddr[2],psta->hwaddr[3],psta->hwaddr[4],psta->hwaddr[5]);
DBG_88E("auth expire %6ph\n",
psta->hwaddr);
_exit_critical_bh(&pstapriv->auth_list_lock, &irqL);
@ -393,7 +338,6 @@ void expire_timeout_chk(_adapter *padapter)
}
}
_exit_critical_bh(&pstapriv->auth_list_lock, &irqL);
psta = NULL;
@ -411,8 +355,7 @@ void expire_timeout_chk(_adapter *padapter)
, FUNC_NDEV_ARG(padapter->pnetdev), pstapriv->asoc_list_cnt);
}
#endif
while ((rtw_end_of_queue_search(phead, plist)) == false)
{
while ((rtw_end_of_queue_search(phead, plist)) == false) {
psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list);
plist = get_next(plist);
@ -432,9 +375,7 @@ void expire_timeout_chk(_adapter *padapter)
if ( (psta->flags & WLAN_STA_HT) && (psta->htpriv.agg_enable_bitmap || psta->under_exist_checking) ) {
// check sta by delba(addba) for 11n STA
// ToDo: use CCX report to check for all STAs
//DBG_88E("asoc check by DELBA/ADDBA! (pstapriv->expire_to=%d s)(psta->expire_to=%d s), [%02x, %d]\n", pstapriv->expire_to*2, psta->expire_to*2, psta->htpriv.agg_enable_bitmap, psta->under_exist_checking);
if ( psta->expire_to <= (pstapriv->expire_to - 50 ) ) {
if ( psta->expire_to <= (pstapriv->expire_to - 50 ) ) {
DBG_88E("asoc expire by DELBA/ADDBA! (%d s)\n", (pstapriv->expire_to-psta->expire_to)*2);
psta->under_exist_checking = 0;
psta->expire_to = 0;
@ -451,13 +392,11 @@ void expire_timeout_chk(_adapter *padapter)
#endif // CONFIG_TX_MCAST2UNI
#endif //CONFIG_ACTIVE_KEEP_ALIVE_CHECK
if (psta->expire_to <= 0)
{
if (psta->expire_to <= 0) {
#ifdef CONFIG_ACTIVE_KEEP_ALIVE_CHECK
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
if (padapter->registrypriv.wifi_spec == 1)
{
if (padapter->registrypriv.wifi_spec == 1) {
psta->expire_to = pstapriv->expire_to;
continue;
}
@ -468,8 +407,6 @@ void expire_timeout_chk(_adapter *padapter)
psta->expire_to = pstapriv->expire_to;
psta->state |= WIFI_STA_ALIVE_CHK_STATE;
//DBG_88E("alive chk, sta:%pM is at ps mode!\n", (psta->hwaddr));
//to update bcn with tim_bitmap for this station
pstapriv->tim_bitmap |= BIT(psta->aid);
update_beacon(padapter, _TIM_IE_, NULL, false);
@ -478,7 +415,6 @@ void expire_timeout_chk(_adapter *padapter)
continue;
}
}
if (pmlmeext->active_keep_alive_check) {
int stainfo_offset;
@ -486,7 +422,6 @@ void expire_timeout_chk(_adapter *padapter)
if (stainfo_offset_valid(stainfo_offset)) {
chk_alive_list[chk_alive_num++] = stainfo_offset;
}
continue;
}
#endif /* CONFIG_ACTIVE_KEEP_ALIVE_CHECK */
@ -496,16 +431,14 @@ void expire_timeout_chk(_adapter *padapter)
DBG_88E("asoc expire %pM, state=0x%x\n", (psta->hwaddr), psta->state);
updated = ap_free_sta(padapter, psta, true, WLAN_REASON_DEAUTH_LEAVING);
}
else
{
} else {
/* TODO: Aging mechanism to digest frames in sleep_q to avoid running out of xmitframe */
if (psta->sleepq_len > (NR_XMITFRAME/pstapriv->asoc_list_cnt)
&& padapter->xmitpriv.free_xmitframe_cnt < (NR_XMITFRAME/pstapriv->asoc_list_cnt/2)
){
DBG_88E("%s sta:%pM, sleepq_len:%u, free_xmitframe_cnt:%u, asoc_list_cnt:%u, clear sleep_q\n", __func__
, (psta->hwaddr)
, psta->sleepq_len, padapter->xmitpriv.free_xmitframe_cnt, pstapriv->asoc_list_cnt);
if (psta->sleepq_len > (NR_XMITFRAME/pstapriv->asoc_list_cnt) &&
padapter->xmitpriv.free_xmitframe_cnt < (NR_XMITFRAME/pstapriv->asoc_list_cnt/2)) {
DBG_88E("%s sta:%pM, sleepq_len:%u, free_xmitframe_cnt:%u, asoc_list_cnt:%u, clear sleep_q\n", __func__,
(psta->hwaddr), psta->sleepq_len,
padapter->xmitpriv.free_xmitframe_cnt,
pstapriv->asoc_list_cnt);
wakeup_sta_to_xmit(padapter, psta);
}
}
@ -514,57 +447,52 @@ void expire_timeout_chk(_adapter *padapter)
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
#ifdef CONFIG_ACTIVE_KEEP_ALIVE_CHECK
if (chk_alive_num) {
if (chk_alive_num) {
u8 backup_oper_channel=0;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
/* switch to correct channel of current network before issue keep-alive frames */
if (rtw_get_oper_ch(padapter) != pmlmeext->cur_channel) {
backup_oper_channel = rtw_get_oper_ch(padapter);
SelectChannel(padapter, pmlmeext->cur_channel);
}
u8 backup_oper_channel=0;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
/* switch to correct channel of current network before issue keep-alive frames */
if (rtw_get_oper_ch(padapter) != pmlmeext->cur_channel) {
backup_oper_channel = rtw_get_oper_ch(padapter);
SelectChannel(padapter, pmlmeext->cur_channel);
}
/* issue null data to check sta alive*/
for (i = 0; i < chk_alive_num; i++) {
/* issue null data to check sta alive*/
for (i = 0; i < chk_alive_num; i++) {
int ret = _FAIL;
int ret = _FAIL;
psta = rtw_get_stainfo_by_offset(pstapriv, chk_alive_list[i]);
psta = rtw_get_stainfo_by_offset(pstapriv, chk_alive_list[i]);
if (psta->state & WIFI_SLEEP_STATE)
ret = issue_nulldata(padapter, psta->hwaddr, 0, 1, 50);
else
ret = issue_nulldata(padapter, psta->hwaddr, 0, 3, 50);
if (psta->state & WIFI_SLEEP_STATE)
ret = issue_nulldata(padapter, psta->hwaddr, 0, 1, 50);
else
ret = issue_nulldata(padapter, psta->hwaddr, 0, 3, 50);
psta->keep_alive_trycnt++;
if (ret == _SUCCESS) {
DBG_88E("asoc check, sta(%pM) is alive\n", (psta->hwaddr));
psta->expire_to = pstapriv->expire_to;
psta->keep_alive_trycnt = 0;
continue;
} else if (psta->keep_alive_trycnt <= 3) {
DBG_88E("ack check for asoc expire, keep_alive_trycnt=%d\n", psta->keep_alive_trycnt);
psta->expire_to = 1;
continue;
}
psta->keep_alive_trycnt++;
if (ret == _SUCCESS)
{
DBG_88E("asoc check, sta(%pM) is alive\n", (psta->hwaddr));
psta->expire_to = pstapriv->expire_to;
psta->keep_alive_trycnt = 0;
continue;
}
else if (psta->keep_alive_trycnt <= 3)
{
DBG_88E("ack check for asoc expire, keep_alive_trycnt=%d\n", psta->keep_alive_trycnt);
psta->expire_to = 1;
continue;
DBG_88E("asoc expire %pM, state=0x%x\n", (psta->hwaddr), psta->state);
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
rtw_list_delete(&psta->asoc_list);
pstapriv->asoc_list_cnt--;
updated = ap_free_sta(padapter, psta, true, WLAN_REASON_DEAUTH_LEAVING);
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
}
psta->keep_alive_trycnt = 0;
DBG_88E("asoc expire %pM, state=0x%x\n", (psta->hwaddr), psta->state);
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
rtw_list_delete(&psta->asoc_list);
pstapriv->asoc_list_cnt--;
updated = ap_free_sta(padapter, psta, true, WLAN_REASON_DEAUTH_LEAVING);
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
if (backup_oper_channel>0) /* back to the original operation channel */
SelectChannel(padapter, backup_oper_channel);
}
if (backup_oper_channel>0) /* back to the original operation channel */
SelectChannel(padapter, backup_oper_channel);
}
#endif /* CONFIG_ACTIVE_KEEP_ALIVE_CHECK */
associated_clients_update(padapter, updated);
@ -593,22 +521,20 @@ void add_RATid(_adapter *padapter, struct sta_info *psta, u8 rssi_level)
return;
//b/g mode ra_bitmap
for (i=0; i<sizeof(psta->bssrateset); i++)
{
for (i = 0; i < sizeof(psta->bssrateset); i++) {
if (psta->bssrateset[i])
tx_ra_bitmap |= rtw_get_bit_value_from_ieee_value(psta->bssrateset[i]&0x7f);
}
#ifdef CONFIG_80211N_HT
//n mode ra_bitmap
if (psta_ht->ht_option)
{
if (psta_ht->ht_option) {
rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
if (rf_type == RF_2T2R)
limit=16;// 2R
else
limit=8;// 1R
for (i=0; i<limit; i++) {
for (i = 0; i < limit; i++) {
if (psta_ht->ht_cap.supp_mcs_set[i/8] & BIT(i%8))
tx_ra_bitmap |= BIT(i+12);
}
@ -638,8 +564,7 @@ void add_RATid(_adapter *padapter, struct sta_info *psta, u8 rssi_level)
raid = networktype_to_raid(sta_band);
init_rate = get_highest_rate_idx(tx_ra_bitmap&0x0fffffff)&0x3f;
if (psta->aid < NUM_STA)
{
if (psta->aid < NUM_STA) {
u8 arg = 0;
arg = psta->mac_id&0x1f;
@ -660,7 +585,6 @@ void add_RATid(_adapter *padapter, struct sta_info *psta, u8 rssi_level)
//arg[5] = Short GI
rtw_hal_add_ra_tid(padapter, tx_ra_bitmap, arg, rssi_level);
if (shortGIrate==true)
init_rate |= BIT(6);
@ -668,12 +592,9 @@ void add_RATid(_adapter *padapter, struct sta_info *psta, u8 rssi_level)
psta->raid = raid;
psta->init_rate = init_rate;
}
else
{
} else {
DBG_88E("station aid %d exceed the max number\n", psta->aid);
}
}
static void update_bmc_sta(_adapter *padapter)
@ -687,10 +608,8 @@ static void update_bmc_sta(_adapter *padapter)
WLAN_BSSID_EX *pcur_network = (WLAN_BSSID_EX *)&pmlmepriv->cur_network.network;
struct sta_info *psta = rtw_get_bcmc_stainfo(padapter);
if (psta)
{
if (psta) {
psta->aid = 0;//default set to 0
//psta->mac_id = psta->aid+4;
psta->mac_id = psta->aid + 1;
psta->qos_option = 0;
@ -702,10 +621,6 @@ static void update_bmc_sta(_adapter *padapter)
_rtw_memset((void*)&psta->sta_stats, 0, sizeof(struct stainfo_stats));
//psta->dot118021XPrivacy = _NO_PRIVACY_;//!!! remove it, because it has been set before this.
//prepare for add_RATid
supportRateNum = rtw_get_rateset_len((u8*)&pcur_network->SupportedRates);
network_type = rtw_check_network_type((u8*)&pcur_network->SupportedRates, supportRateNum, 1);
@ -714,8 +629,7 @@ static void update_bmc_sta(_adapter *padapter)
psta->bssratelen = supportRateNum;
//b/g mode ra_bitmap
for (i=0; i<supportRateNum; i++)
{
for (i = 0; i < supportRateNum; i++) {
if (psta->bssrateset[i])
tx_ra_bitmap |= rtw_get_bit_value_from_ieee_value(psta->bssrateset[i]&0x7f);
}
@ -730,28 +644,18 @@ static void update_bmc_sta(_adapter *padapter)
tx_ra_bitmap = 0xf;
}
//tx_ra_bitmap = update_basic_rate(pcur_network->SupportedRates, supportRateNum);
raid = networktype_to_raid(network_type);
init_rate = get_highest_rate_idx(tx_ra_bitmap&0x0fffffff)&0x3f;
//DBG_88E("Add id %d val %08x to ratr for bmc sta\n", psta->aid, tx_ra_bitmap);
//ap mode
rtw_hal_set_odm_var(padapter, HAL_ODM_STA_INFO, psta, true);
//if (pHalData->fw_ractrl == true)
{
u8 arg = 0;
arg = psta->mac_id&0x1f;
arg |= BIT(7);
//if (shortGIrate==true)
// arg |= BIT(5);
tx_ra_bitmap |= ((raid<<28)&0xf0000000);
DBG_88E("update_bmc_sta, mask=0x%x, arg=0x%x\n", tx_ra_bitmap, arg);
//bitmap[0:27] = tx_rate_bitmap
@ -759,9 +663,7 @@ static void update_bmc_sta(_adapter *padapter)
//arg[0:4] = macid
//arg[5] = Short GI
rtw_hal_add_ra_tid(padapter, tx_ra_bitmap, arg, 0);
}
//set ra_id, init_rate
psta->raid = raid;
psta->init_rate = init_rate;
@ -772,12 +674,9 @@ static void update_bmc_sta(_adapter *padapter)
psta->state = _FW_LINKED;
_exit_critical_bh(&psta->lock, &irqL);
}
else
{
} else {
DBG_88E("add_RATid_bmc_sta error!\n");
}
}
//notes:
@ -797,10 +696,6 @@ void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta)
struct ht_priv *phtpriv_ap = &pmlmepriv->htpriv;
struct ht_priv *phtpriv_sta = &psta->htpriv;
#endif //CONFIG_80211N_HT
//set intf_tag to if1
//psta->intf_tag = 0;
//psta->mac_id = psta->aid+4;
psta->mac_id = psta->aid+1;
DBG_88E("%s\n",__func__);
@ -819,33 +714,22 @@ void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta)
VCS_update(padapter, psta);
#ifdef CONFIG_80211N_HT
//HT related cap
if (phtpriv_sta->ht_option)
{
if (phtpriv_sta->ht_option) {
//check if sta supports rx ampdu
phtpriv_sta->ampdu_enable = phtpriv_ap->ampdu_enable;
//check if sta support s Short GI
if ((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SGI_20|IEEE80211_HT_CAP_SGI_40))
{
phtpriv_sta->sgi = true;
}
// bwmode
if ((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH))
{
//phtpriv_sta->bwmode = HT_CHANNEL_WIDTH_40;
if ((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH)) {
phtpriv_sta->bwmode = pmlmeext->cur_bwmode;
phtpriv_sta->ch_offset = pmlmeext->cur_ch_offset;
}
psta->qos_option = true;
}
else
{
} else {
phtpriv_sta->ampdu_enable = false;
phtpriv_sta->sgi = false;
phtpriv_sta->bwmode = HT_CHANNEL_WIDTH_20;
phtpriv_sta->ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
@ -864,16 +748,9 @@ void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta)
_rtw_memset((void*)&psta->sta_stats, 0, sizeof(struct stainfo_stats));
//add ratid
//add_RATid(padapter, psta);//move to ap_sta_info_defer_update()
_enter_critical_bh(&psta->lock, &irqL);
psta->state |= _FW_LINKED;
_exit_critical_bh(&psta->lock, &irqL);
}
static void update_hw_ht_param(_adapter *padapter)
@ -886,7 +763,6 @@ static void update_hw_ht_param(_adapter *padapter)
DBG_88E("%s\n", __func__);
//handle A-MPDU parameter field
/*
AMPDU_para [1:0]:Max AMPDU Len => 0:8k , 1:16k, 2:32k, 3:64k
@ -905,21 +781,7 @@ static void update_hw_ht_param(_adapter *padapter)
//
pmlmeinfo->SM_PS = (pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info & 0x0C) >> 2;
if (pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC)
{
/*u8 i;
//update the MCS rates
for (i = 0; i < 16; i++)
{
pmlmeinfo->HT_caps.HT_cap_element.MCS_rate[i] &= MCS_rate_1R[i];
}*/
DBG_88E("%s(): WLAN_HT_CAP_SM_PS_STATIC\n",__func__);
}
//
// Config current HT Protection mode.
//
//pmlmeinfo->HT_protection = pmlmeinfo->HT_info.infos[1] & 0x3;
}
static void start_bss_network(_adapter *padapter, u8 *pbuf)
@ -941,8 +803,6 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
#endif //CONFIG_P2P
//DBG_88E("%s\n", __func__);
bcn_interval = (u16)pnetwork->Configuration.BeaconPeriod;
cur_channel = pnetwork->Configuration.DSConfig;
cur_bwmode = HT_CHANNEL_WIDTH_20;;
@ -958,27 +818,21 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
}
//todo: update wmm, ht cap
//pmlmeinfo->WMM_enable;
//pmlmeinfo->HT_enable;
if (pmlmepriv->qospriv.qos_option)
pmlmeinfo->WMM_enable = true;
#ifdef CONFIG_80211N_HT
if (pmlmepriv->htpriv.ht_option)
{
if (pmlmepriv->htpriv.ht_option) {
pmlmeinfo->WMM_enable = true;
pmlmeinfo->HT_enable = true;
//pmlmeinfo->HT_info_enable = true;
//pmlmeinfo->HT_caps_enable = true;
update_hw_ht_param(padapter);
}
#endif //#CONFIG_80211N_HT
if (pmlmepriv->cur_network.join_res != true) //setting only at first time
{
if (pmlmepriv->cur_network.join_res != true) { //setting only at first time
//WEP Key will be set before this function, do not clear CAM.
if ((psecuritypriv->dot11PrivacyAlgrthm != _WEP40_) && (psecuritypriv->dot11PrivacyAlgrthm != _WEP104_))
if ((psecuritypriv->dot11PrivacyAlgrthm != _WEP40_) &&
(psecuritypriv->dot11PrivacyAlgrthm != _WEP104_))
flush_all_cam_entry(padapter); //clear CAM
}
@ -997,7 +851,6 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_VO, (u8 *)(&acparm));
acparm = 0x005E4317; // VI
rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_VI, (u8 *)(&acparm));
//acparm = 0x00105320; // BE
acparm = 0x005ea42b;
rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_BE, (u8 *)(&acparm));
acparm = 0x0000A444; // BK
@ -1010,90 +863,56 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
//Beacon Control related register
rtw_hal_set_hwreg(padapter, HW_VAR_BEACON_INTERVAL, (u8 *)(&bcn_interval));
UpdateBrateTbl(padapter, pnetwork->SupportedRates);
rtw_hal_set_hwreg(padapter, HW_VAR_BASIC_RATE, pnetwork->SupportedRates);
if (pmlmepriv->cur_network.join_res != true) //setting only at first time
{
//u32 initialgain;
//initialgain = 0x1e;
//disable dynamic functions, such as high power, DIG
//Save_DM_Func_Flag(padapter);
//Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, false);
if (pmlmepriv->cur_network.join_res != true) { //setting only at first time
#ifdef CONFIG_CONCURRENT_MODE
if (padapter->adapter_type > PRIMARY_ADAPTER)
{
if (rtw_buddy_adapter_up(padapter))
{
if (padapter->adapter_type > PRIMARY_ADAPTER) {
if (rtw_buddy_adapter_up(padapter)) {
_adapter *pbuddy_adapter = padapter->pbuddy_adapter;
//turn on all dynamic functions on PRIMARY_ADAPTER, dynamic functions only runs at PRIMARY_ADAPTER
Switch_DM_Func(pbuddy_adapter, DYNAMIC_ALL_FUNC_ENABLE, true);
//rtw_hal_set_hwreg(pbuddy_adapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain));
}
}
else
} else
#endif
{
//turn on all dynamic functions
Switch_DM_Func(padapter, DYNAMIC_ALL_FUNC_ENABLE, true);
//rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain));
}
}
#ifdef CONFIG_80211N_HT
//set channel, bwmode
p = rtw_get_ie((pnetwork->IEs + sizeof(NDIS_802_11_FIXED_IEs)), _HT_ADD_INFO_IE_, &ie_len, (pnetwork->IELength - sizeof(NDIS_802_11_FIXED_IEs)));
if ( p && ie_len)
{
if ( p && ie_len) {
pht_info = (struct HT_info_element *)(p+2);
if ((pregpriv->cbw40_enable) && (pht_info->infos[0] & BIT(2)))
{
if ((pregpriv->cbw40_enable) && (pht_info->infos[0] & BIT(2))) {
//switch to the 40M Hz mode
//pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_40;
cur_bwmode = HT_CHANNEL_WIDTH_40;
switch (pht_info->infos[0] & 0x3)
{
case 1:
//pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER;
cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER;
break;
case 3:
//pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER;
cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER;
break;
default:
//pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
break;
switch (pht_info->infos[0] & 0x3) {
case 1:
cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER;
break;
case 3:
cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER;
break;
default:
cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
break;
}
}
}
#endif //CONFIG_80211N_HT
#ifdef CONFIG_DUALMAC_CONCURRENT
dc_set_ap_channel_bandwidth(padapter, cur_channel, cur_ch_offset, cur_bwmode);
#else
//TODO: need to judge the phy parameters on concurrent mode for single phy
//set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode);
#ifdef CONFIG_CONCURRENT_MODE
if (!check_buddy_fwstate(padapter, _FW_LINKED|_FW_UNDER_LINKING|_FW_UNDER_SURVEY))
{
set_channel_bwmode(padapter, cur_channel, cur_ch_offset, cur_bwmode);
}
else if (check_buddy_fwstate(padapter, _FW_LINKED)==true)//only second adapter can enter AP Mode
{
if (!check_buddy_fwstate(padapter, _FW_LINKED|_FW_UNDER_LINKING|_FW_UNDER_SURVEY)) {
set_channel_bwmode(padapter, cur_channel, cur_ch_offset, cur_bwmode);
} else if (check_buddy_fwstate(padapter, _FW_LINKED)==true) {//only second adapter can enter AP Mode
_adapter *pbuddy_adapter = padapter->pbuddy_adapter;
struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
@ -1103,40 +922,32 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
DBG_88E("second adapter, CH=%d, BW=%d, offset=%d\n", cur_channel, cur_bwmode, cur_ch_offset);
cur_channel = pbuddy_mlmeext->cur_channel;
if (cur_bwmode == HT_CHANNEL_WIDTH_40)
{
if (cur_bwmode == HT_CHANNEL_WIDTH_40) {
if (pht_info)
pht_info->infos[0] &= ~(BIT(0)|BIT(1));
if (pbuddy_mlmeext->cur_bwmode == HT_CHANNEL_WIDTH_40)
{
if (pbuddy_mlmeext->cur_bwmode == HT_CHANNEL_WIDTH_40) {
cur_ch_offset = pbuddy_mlmeext->cur_ch_offset;
//to update cur_ch_offset value in beacon
if (pht_info)
{
switch (cur_ch_offset)
{
case HAL_PRIME_CHNL_OFFSET_LOWER:
pht_info->infos[0] |= 0x1;
break;
case HAL_PRIME_CHNL_OFFSET_UPPER:
pht_info->infos[0] |= 0x3;
break;
case HAL_PRIME_CHNL_OFFSET_DONT_CARE:
default:
break;
if (pht_info) {
switch (cur_ch_offset) {
case HAL_PRIME_CHNL_OFFSET_LOWER:
pht_info->infos[0] |= 0x1;
break;
case HAL_PRIME_CHNL_OFFSET_UPPER:
pht_info->infos[0] |= 0x3;
break;
case HAL_PRIME_CHNL_OFFSET_DONT_CARE:
default:
break;
}
}
}
else if (pbuddy_mlmeext->cur_bwmode == HT_CHANNEL_WIDTH_20)
{
} else if (pbuddy_mlmeext->cur_bwmode == HT_CHANNEL_WIDTH_20) {
cur_bwmode = HT_CHANNEL_WIDTH_20;
cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
if (cur_channel>0 && cur_channel<5)
{
if (cur_channel > 0 && cur_channel < 5) {
if (pht_info)
pht_info->infos[0] |= 0x1;
@ -1144,8 +955,7 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER;
}
if (cur_channel>7 && cur_channel<(14+1))
{
if (cur_channel > 7 && cur_channel < (14+1)) {
if (pht_info)
pht_info->infos[0] |= 0x3;
@ -1155,7 +965,6 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
set_channel_bwmode(padapter, cur_channel, cur_ch_offset, cur_bwmode);
}
}
// to update channel value in beacon

View file

@ -28,22 +28,11 @@
#include <linux/if_pppox.h>
#endif
#if 1 // rtw_wifi_driver
#include <drv_conf.h>
#include <drv_types.h>
#include "rtw_br_ext.h"
#else // rtw_wifi_driver
#include "./8192cd_cfg.h"
#ifndef __KERNEL__
#include "./sys-support.h"
#endif
#include "./8192cd.h"
#include "./8192cd_headers.h"
#include "./8192cd_br_ext.h"
#include "./8192cd_debug.h"
#endif // rtw_wifi_driver
#include <usb_osintf.h>
#include <recv_osdep.h>
#ifndef csum_ipv6_magic
#include <net/ip6_checksum.h>
@ -102,7 +91,7 @@ static __inline__ unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, un
return cur_ptr;
cur_ptr = cur_ptr + TAG_HDR_LEN + tagLen;
}
return 0;
return NULL;
}
@ -853,7 +842,6 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
// forward unknow IP packet to upper TCP/IP
DEBUG_INFO("NAT25: Replace DA with BR's MAC\n");
if ( (*(u32 *)priv->br_mac) == 0 && (*(u16 *)(priv->br_mac+4)) == 0 ) {
void netdev_br_init(struct net_device *netdev);
printk("Re-init netdev_br_init() due to br_mac==0!\n");
netdev_br_init(priv->pnetdev);
}
@ -1299,7 +1287,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
unsigned short tagType, tagLen;
int offset=0;
if ((ptr = __nat25_find_pppoe_tag(ph, ntohs(PTT_RELAY_SID))) == 0) {
if ((ptr = __nat25_find_pppoe_tag(ph, ntohs(PTT_RELAY_SID))) == NULL) {
DEBUG_ERR("Fail to find PTT_RELAY_SID in FADO!\n");
return -1;
}

View file

@ -28,6 +28,7 @@
#ifdef CONFIG_BR_EXT
#include <rtw_br_ext.h>
#endif //CONFIG_BR_EXT
#include <rtw_mlme_ext.h>
#ifdef CONFIG_BT_COEXIST
#include <rtl8723a_hal.h>
@ -1971,7 +1972,7 @@ _func_enter_;
goto exit;
}
_rtw_spinlock(&(padapter->tdlsinfo.cmd_lock));
spin_lock(&(padapter->tdlsinfo.cmd_lock));
_rtw_memcpy(TDLSoption->addr, addr, 6);
TDLSoption->option = option;
_rtw_spinunlock(&(padapter->tdlsinfo.cmd_lock));

View file

@ -22,7 +22,6 @@
#include <drv_conf.h>
#include <osdep_service.h>
#include <drv_types.h>
#include <rtw_efuse.h>
@ -525,7 +524,7 @@ Efuse_PgPacketWrite( PADAPTER pAdapter,
}
int
static int
Efuse_PgPacketWrite_BT( PADAPTER pAdapter,
u8 offset,
u8 word_en,

View file

@ -24,6 +24,7 @@
#include <wifi.h>
#include <osdep_service.h>
#include <wlan_bssdef.h>
#include <usb_osintf.h>
u8 RTW_WPA_OUI_TYPE[] = { 0x00, 0x50, 0xf2, 1 };
u16 RTW_WPA_VERSION = 1;
@ -1261,8 +1262,7 @@ ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len,
}
static u8 key_char2num(u8 ch);
static u8 key_char2num(u8 ch)
u8 key_char2num(u8 ch)
{
if ((ch>='0')&&(ch<='9'))
return ch - '0';
@ -1274,24 +1274,16 @@ static u8 key_char2num(u8 ch)
return 0xff;
}
u8 str_2char2num(u8 hch, u8 lch);
u8 str_2char2num(u8 hch, u8 lch)
{
return ((key_char2num(hch) * 10 ) + key_char2num(lch));
}
u8 key_2char2num(u8 hch, u8 lch);
u8 key_2char2num(u8 hch, u8 lch)
{
return ((key_char2num(hch) << 4) | key_char2num(lch));
}
u8 convert_ip_addr(u8 hch, u8 mch, u8 lch)
{
return ((key_char2num(hch) * 100) + (key_char2num(mch) * 10 ) + key_char2num(lch));
}
extern char* rtw_initmac;
void rtw_macaddr_cfg(u8 *mac_addr)
{
u8 mac[ETH_ALEN];
@ -1768,7 +1760,7 @@ int ieee80211_get_hdrlen(u16 fc)
return hdrlen;
}
int rtw_get_cipher_info(struct wlan_network *pnetwork)
static int rtw_get_cipher_info(struct wlan_network *pnetwork)
{
u32 wpa_ielen;
unsigned char *pbuf;

View file

@ -31,6 +31,7 @@
#include <wifi.h>
#include <wlan_bssdef.h>
#include <rtw_ioctl_set.h>
#include <usb_osintf.h>
extern void indicate_wx_scan_complete_event(_adapter *padapter);
extern u8 rtw_do_join(_adapter * padapter);
@ -1319,33 +1320,26 @@ _func_enter_;
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("tgt_network->network.MacAddress=%pM ssid=%s\n",
tgt_network->network.MacAddress, tgt_network->network.Ssid.Ssid));
if (check_fwstate( pmlmepriv, WIFI_STATION_STATE|WIFI_AP_STATE))
{
if (check_fwstate( pmlmepriv, WIFI_STATION_STATE|WIFI_AP_STATE)) {
struct sta_info* psta;
psta = rtw_get_stainfo(&adapter->stapriv, tgt_network->network.MacAddress);
#ifdef CONFIG_TDLS
if (ptdlsinfo->setup_state != TDLS_STATE_NONE)
{
if (ptdlsinfo->setup_state != TDLS_STATE_NONE) {
rtw_tdls_cmd(adapter, myid(&(adapter->eeprompriv)), TDLS_RS_RCR);
rtw_reset_tdls_info(adapter);
rtw_free_all_stainfo(adapter);
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
}
else
} else
#endif //CONFIG_TDLS
{
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
rtw_free_stainfo(adapter, psta);
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
}
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
}
if (check_fwstate( pmlmepriv, WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE|WIFI_AP_STATE))
{
if (check_fwstate( pmlmepriv, WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE|WIFI_AP_STATE)) {
struct sta_info* psta;
rtw_free_all_stainfo(adapter);
@ -1363,28 +1357,17 @@ _func_enter_;
pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.MacAddress);
if (pwlan)
{
pwlan->fixed = false;
}
else
{
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("rtw_free_assoc_resources : pwlan== NULL\n\n"));
}
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) && (adapter->stapriv.asoc_sta_count== 1))
/*||check_fwstate(pmlmepriv, WIFI_STATION_STATE)*/)
{
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) && (adapter->stapriv.asoc_sta_count== 1)))
rtw_free_network_nolock(pmlmepriv, pwlan);
}
if (lock_scanned_queue)
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
pmlmepriv->key_mask = 0;
_func_exit_;
}
/*
@ -1772,44 +1755,34 @@ _func_enter_;
if (pmlmepriv->assoc_ssid.SsidLength == 0)
{
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("@@@@@ joinbss event call back for Any SSid\n"));
}
else
{
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("@@@@@ rtw_joinbss_event_callback for SSid:%s\n", pmlmepriv->assoc_ssid.Ssid));
}
the_same_macaddr = _rtw_memcmp(pnetwork->network.MacAddress, cur_network->network.MacAddress, ETH_ALEN);
pnetwork->network.Length = get_WLAN_BSSID_EX_sz(&pnetwork->network);
if (pnetwork->network.Length > sizeof(WLAN_BSSID_EX))
{
if (pnetwork->network.Length > sizeof(WLAN_BSSID_EX)) {
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("\n\n ***joinbss_evt_callback return a wrong bss ***\n\n"));
goto ignore_joinbss_callback;
goto ignore_nolock;
}
_enter_critical_bh(&pmlmepriv->lock, &irqL);
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n rtw_joinbss_event_callback !! _enter_critical\n"));
if (pnetwork->join_res > 0)
{
if (pnetwork->join_res > 0) {
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
retry = 0;
if (check_fwstate(pmlmepriv,_FW_UNDER_LINKING) )
{
if (check_fwstate(pmlmepriv,_FW_UNDER_LINKING) ) {
//s1. find ptarget_wlan
if (check_fwstate(pmlmepriv, _FW_LINKED) )
{
if (the_same_macaddr == true)
{
if (check_fwstate(pmlmepriv, _FW_LINKED) ) {
if (the_same_macaddr == true) {
ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.MacAddress);
}
else
{
} else {
pcur_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.MacAddress);
if (pcur_wlan) pcur_wlan->fixed = false;
if (pcur_wlan)
pcur_wlan->fixed = false;
pcur_sta = rtw_get_stainfo(pstapriv, cur_network->network.MacAddress);
if (pcur_sta){
@ -1819,27 +1792,23 @@ _func_enter_;
}
ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, pnetwork->network.MacAddress);
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true){
if (ptarget_wlan) ptarget_wlan->fixed = true;
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) {
if (ptarget_wlan)
ptarget_wlan->fixed = true;
}
}
}
else
{
} else {
ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, pnetwork->network.MacAddress);
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true){
if (ptarget_wlan) ptarget_wlan->fixed = true;
if (ptarget_wlan)
ptarget_wlan->fixed = true;
}
}
//s2. update cur_network
if (ptarget_wlan)
{
if (ptarget_wlan) {
rtw_joinbss_update_network(adapter, ptarget_wlan, pnetwork);
}
else
{
} else {
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("Can't find ptarget_wlan when joinbss_event callback\n"));
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
goto ignore_joinbss_callback;
@ -1847,11 +1816,9 @@ _func_enter_;
//s3. find ptarget_sta & update ptarget_sta after update cur_network only for station mode
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true)
{
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) {
ptarget_sta = rtw_joinbss_update_stainfo(adapter, pnetwork);
if (ptarget_sta==NULL)
{
if (ptarget_sta==NULL) {
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("Can't update stainfo when joinbss_event callback\n"));
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
goto ignore_joinbss_callback;
@ -1859,25 +1826,19 @@ _func_enter_;
}
//s4. indicate connect
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true)
{
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) {
rtw_indicate_connect(adapter);
}
else
{
} else {
//adhoc mode will rtw_indicate_connect when rtw_stassoc_event_callback
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("adhoc mode, fw_state:%x", get_fwstate(pmlmepriv)));
}
//s5. Cancle assoc_timer
_cancel_timer(&pmlmepriv->assoc_timer, &timer_cancelled);
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("Cancle assoc_timer\n"));
}
else
{
} else {
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("rtw_joinbss_event_callback err: fw_state:%x", get_fwstate(pmlmepriv)));
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
goto ignore_joinbss_callback;
@ -1885,23 +1846,15 @@ _func_enter_;
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
}
else if (pnetwork->join_res == -4)
{
} else if (pnetwork->join_res == -4) {
rtw_reset_securitypriv(adapter);
_set_timer(&pmlmepriv->assoc_timer, 1);
//rtw_free_assoc_resources(adapter, 1);
if ((check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) == true)
{
if ((check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) == true) {
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("fail! clear _FW_UNDER_LINKING ^^^fw_state=%x\n", get_fwstate(pmlmepriv)));
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
}
}
else //if join_res < 0 (join fails), then try again
{
} else { //if join_res < 0 (join fails), then try again
#ifdef REJOIN
res = _FAIL;
@ -1910,24 +1863,18 @@ _func_enter_;
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("rtw_select_and_join_from_scanned_queue again! res:%d\n",res));
}
if (res == _SUCCESS)
{
if (res == _SUCCESS) {
//extend time of assoc_timer
_set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT);
retry++;
}
else if (res == 2)//there is no need to wait for join
{
} else if (res == 2) { //there is no need to wait for join
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
rtw_indicate_connect(adapter);
}
else
{
} else {
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("Set Assoc_Timer = 1; can't find match ssid in scanned_q\n"));
#endif
_set_timer(&pmlmepriv->assoc_timer, 1);
//rtw_free_assoc_resources(adapter, 1);
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
#ifdef REJOIN
@ -1937,9 +1884,9 @@ _func_enter_;
}
ignore_joinbss_callback:
_exit_critical_bh(&pmlmepriv->lock, &irqL);
_func_exit_;
ignore_nolock:
_func_exit_;
}
void rtw_joinbss_event_callback(_adapter *adapter, u8 *pbuf)
@ -1963,7 +1910,7 @@ _func_enter_;
_func_exit_;
}
u8 search_max_mac_id(_adapter *padapter)
static u8 search_max_mac_id(_adapter *padapter)
{
u8 mac_id, aid;
#if (RATE_ADAPTIVE_SUPPORT==1) //for 88E RA
@ -2531,7 +2478,6 @@ void rtw_dynamic_check_timer_handlder(_adapter *adapter)
&& (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true) )
{
// expire NAT2.5 entry
void nat25_db_expire(_adapter *priv);
nat25_db_expire(adapter);
if (adapter->pppoe_connection_in_progress > 0) {
@ -2651,19 +2597,15 @@ static int rtw_check_join_candidate(struct mlme_priv *pmlmepriv
}
if (updated){
DBG_88E("[by_bssid:%u][assoc_ssid:%s]"
#ifdef CONFIG_LAYER2_ROAMING
"[to_roaming:%u] "
#endif
"new candidate: %s(%pM rssi:%d\n",
pmlmepriv->assoc_by_bssid,
pmlmepriv->assoc_ssid.Ssid,
#ifdef CONFIG_LAYER2_ROAMING
pmlmepriv->to_roaming,
#endif
(*candidate)->network.Ssid.Ssid,
(*candidate)->network.MacAddress,
(int)(*candidate)->network.Rssi
);
(int)(*candidate)->network.Rssi);
#ifdef CONFIG_LAYER2_ROAMING
DBG_88E("[to_roaming:%u]\n", pmlmepriv->to_roaming);
#endif
}
exit:

View file

@ -25,7 +25,7 @@
#ifdef CONFIG_P2P
int rtw_p2p_is_channel_list_ok( u8 desired_ch, u8* ch_list, u8 ch_cnt )
static int rtw_p2p_is_channel_list_ok( u8 desired_ch, u8* ch_list, u8 ch_cnt )
{
int found = 0, i = 0;
@ -40,7 +40,7 @@ int rtw_p2p_is_channel_list_ok( u8 desired_ch, u8* ch_list, u8 ch_cnt )
return( found );
}
int is_any_client_associated( _adapter *padapter )
static int is_any_client_associated( _adapter *padapter)
{
_irqL irqL;
_list *phead, *plist;

View file

@ -135,12 +135,7 @@ extern void autosuspend_enter(_adapter* padapter);
extern int autoresume_enter(_adapter* padapter);
#endif
#ifdef SUPPORT_HW_RFOFF_DETECTED
int rtw_hw_suspend(_adapter *padapter );
int rtw_hw_resume(_adapter *padapter);
#endif
bool rtw_pwr_unassociated_idle(_adapter *adapter)
static bool rtw_pwr_unassociated_idle(_adapter *adapter)
{
_adapter *buddy = adapter->pbuddy_adapter;
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);

View file

@ -26,17 +26,7 @@
#include <ip.h>
#include <if_ether.h>
#include <ethernet.h>
#ifdef CONFIG_USB_HCI
#include <usb_ops.h>
#endif
#if defined (PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
#error "Shall be Linux or Windows, but not both!\n"
#endif
#include <wifi.h>
#include <circ_buf.h>
@ -55,9 +45,6 @@ _func_enter_;
_rtw_spinlock_init(&psta_recvpriv->lock);
//for (i=0; i<MAX_RX_NUMBLKS; i++)
// _rtw_init_queue(&psta_recvpriv->blk_strms[i]);
_rtw_init_queue(&psta_recvpriv->defrag_q);
_func_exit_;
@ -372,7 +359,7 @@ void rtw_free_recvframe_queue(_queue *pframequeue, _queue *pfree_recv_queue)
_list *plist, *phead;
_func_enter_;
_rtw_spinlock(&pframequeue->lock);
spin_lock(&pframequeue->lock);
phead = get_list_head(pframequeue);
plist = get_next(phead);
@ -388,7 +375,7 @@ _func_enter_;
rtw_free_recvframe(precvframe, pfree_recv_queue);
}
_rtw_spinunlock(&pframequeue->lock);
spin_unlock(&pframequeue->lock);
_func_exit_;
@ -2594,10 +2581,8 @@ _func_enter_;
//Then enqueue the 0~(n-1) fragment into the defrag_q
//_rtw_spinlock(&pdefrag_q->lock);
phead = get_list_head(pdefrag_q);
rtw_list_insert_tail(&pfhdr->list, phead);
//_rtw_spinunlock(&pdefrag_q->lock);
RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("Enqueuq: ismfrag = %d, fragnum= %d\n", ismfrag,fragnum));
@ -2620,10 +2605,8 @@ _func_enter_;
//enqueue the last fragment
if (pdefrag_q != NULL)
{
//_rtw_spinlock(&pdefrag_q->lock);
phead = get_list_head(pdefrag_q);
rtw_list_insert_tail(&pfhdr->list,phead);
//_rtw_spinunlock(&pdefrag_q->lock);
//call recvframe_defrag to defrag
RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("defrag: ismfrag = %d, fragnum= %d\n", ismfrag, fragnum));
@ -2659,7 +2642,7 @@ _func_exit_;
}
int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe)
static int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe)
{
#if defined (PLATFORM_LINUX) || defined (PLATFORM_FREEBSD) //for amsdu TP improvement,Creator: Thomas
int a_len, padding_len;
@ -2815,25 +2798,7 @@ int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe)
rcu_read_unlock();
#endif // (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
if ( br_port && (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true) )
{
int nat25_handle_frame(_adapter *priv, struct sk_buff *skb);
if (nat25_handle_frame(padapter, sub_skb) == -1) {
//priv->ext_stats.rx_data_drops++;
//DEBUG_ERR("RX DROP: nat25_handle_frame fail!\n");
//return FAIL;
#if 1
// bypass this frame to upper layer!!
#else
dev_kfree_skb_any(sub_skb);
continue;
#endif
}
}
#endif // CONFIG_BR_EXT
sub_skb->protocol = eth_type_trans(sub_skb, padapter->pnetdev);
sub_skb->dev = padapter->pnetdev;
@ -3128,7 +3093,7 @@ exit:
#endif
}
int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_num)
static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_num)
{
u8 wsize = preorder_ctrl->wsize_b;
u16 wend = (preorder_ctrl->indicate_seq + wsize -1) & 0xFFF;//% 4096;
@ -3206,87 +3171,45 @@ int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, union rec
union recv_frame *pnextrframe;
struct rx_pkt_attrib *pnextattrib;
//DbgPrint("+enqueue_reorder_recvframe()\n");
//_enter_critical_ex(&ppending_recvframe_queue->lock, &irql);
//_rtw_spinlock_ex(&ppending_recvframe_queue->lock);
phead = get_list_head(ppending_recvframe_queue);
plist = get_next(phead);
while (rtw_end_of_queue_search(phead, plist) == false)
{
while (rtw_end_of_queue_search(phead, plist) == false) {
pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u);
pnextattrib = &pnextrframe->u.hdr.attrib;
if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num))
{
plist = get_next(plist);
}
else if ( SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num))
{
//Duplicate entry is found!! Do not insert current entry.
//RT_TRACE(COMP_RX_REORDER, DBG_TRACE, ("InsertRxReorderList(): Duplicate packet is dropped!! IndicateSeq: %d, NewSeq: %d\n", pTS->RxIndicateSeq, SeqNum));
//_exit_critical_ex(&ppending_recvframe_queue->lock, &irql);
return false;
}
else
{
break;
}
//DbgPrint("enqueue_reorder_recvframe():while\n");
}
//_enter_critical_ex(&ppending_recvframe_queue->lock, &irql);
//_rtw_spinlock_ex(&ppending_recvframe_queue->lock);
rtw_list_delete(&(prframe->u.hdr.list));
rtw_list_insert_tail(&(prframe->u.hdr.list), plist);
//_rtw_spinunlock_ex(&ppending_recvframe_queue->lock);
//_exit_critical_ex(&ppending_recvframe_queue->lock, &irql);
//RT_TRACE(COMP_RX_REORDER, DBG_TRACE, ("InsertRxReorderList(): Pkt insert into buffer!! IndicateSeq: %d, NewSeq: %d\n", pTS->RxIndicateSeq, SeqNum));
return true;
}
int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ctrl *preorder_ctrl, int bforced);
int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ctrl *preorder_ctrl, int bforced)
static int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ctrl *preorder_ctrl, int bforced)
{
//_irqL irql;
//u8 bcancelled;
_list *phead, *plist;
union recv_frame *prframe;
struct rx_pkt_attrib *pattrib;
//u8 index = 0;
int bPktInBuf = false;
struct recv_priv *precvpriv = &padapter->recvpriv;
_queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
//DbgPrint("+recv_indicatepkts_in_order\n");
//_enter_critical_ex(&ppending_recvframe_queue->lock, &irql);
//_rtw_spinlock_ex(&ppending_recvframe_queue->lock);
phead = get_list_head(ppending_recvframe_queue);
plist = get_next(phead);
// Handling some condition for forced indicate case.
if (bforced==true)
{
if (bforced==true) {
if (rtw_is_list_empty(phead))
return true;
prframe = LIST_CONTAINOR(plist, union recv_frame, u);
prframe = LIST_CONTAINOR(plist, union recv_frame, u);
pattrib = &prframe->u.hdr.attrib;
preorder_ctrl->indicate_seq = pattrib->seq_num;
#ifdef DBG_RX_SEQ
@ -3297,14 +3220,12 @@ int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ctrl *pre
// Prepare indication list and indication.
// Check if there is any packet need indicate.
while (!rtw_is_list_empty(phead))
{
while (!rtw_is_list_empty(phead)) {
prframe = LIST_CONTAINOR(plist, union recv_frame, u);
pattrib = &prframe->u.hdr.attrib;
if (!SN_LESS(preorder_ctrl->indicate_seq, pattrib->seq_num))
{
if (!SN_LESS(preorder_ctrl->indicate_seq, pattrib->seq_num)) {
RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_,
("recv_indicatepkts_in_order: indicate=%d seq=%d amsdu=%d\n",
preorder_ctrl->indicate_seq, pattrib->seq_num, pattrib->amsdu));
@ -3657,7 +3578,7 @@ int process_recv_indicatepkts(_adapter *padapter, union recv_frame *prframe)
}
int recv_func_prehandle(_adapter *padapter, union recv_frame *rframe)
static int recv_func_prehandle(_adapter *padapter, union recv_frame *rframe)
{
int ret = _SUCCESS;
struct rx_pkt_attrib *pattrib = &rframe->u.hdr.attrib;
@ -3701,7 +3622,7 @@ exit:
return ret;
}
int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe)
static int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe)
{
int ret = _SUCCESS;
union recv_frame *orig_prframe = prframe;

View file

@ -31,7 +31,7 @@ struct ch_freq {
u32 frequency;
};
struct ch_freq ch_freq_map[] = {
static struct ch_freq ch_freq_map[] = {
{1, 2412},{2, 2417},{3, 2422},{4, 2427},{5, 2432},
{6, 2437},{7, 2442},{8, 2447},{9, 2452},{10, 2457},
{11, 2462},{12, 2467},{13, 2472},{14, 2484},
@ -53,7 +53,7 @@ struct ch_freq ch_freq_map[] = {
{216, 5080},/* Japan, means J16 */
};
int ch_freq_map_num = (sizeof(ch_freq_map) / sizeof(struct ch_freq));
static int ch_freq_map_num = (sizeof(ch_freq_map) / sizeof(struct ch_freq));
u32 rtw_ch2freq(u32 channel)
{

View file

@ -25,19 +25,19 @@
#include <wifi.h>
unsigned char ARTHEROS_OUI1[] = {0x00, 0x03, 0x7f};
unsigned char ARTHEROS_OUI2[] = {0x00, 0x13, 0x74};
static unsigned char ARTHEROS_OUI1[] = {0x00, 0x03, 0x7f};
static unsigned char ARTHEROS_OUI2[] = {0x00, 0x13, 0x74};
unsigned char BROADCOM_OUI1[] = {0x00, 0x10, 0x18};
unsigned char BROADCOM_OUI2[] = {0x00, 0x0a, 0xf7};
unsigned char BROADCOM_OUI3[] = {0x00, 0x05, 0xb5};
static unsigned char BROADCOM_OUI1[] = {0x00, 0x10, 0x18};
static unsigned char BROADCOM_OUI2[] = {0x00, 0x0a, 0xf7};
static unsigned char BROADCOM_OUI3[] = {0x00, 0x05, 0xb5};
unsigned char CISCO_OUI[] = {0x00, 0x40, 0x96};
unsigned char MARVELL_OUI[] = {0x00, 0x50, 0x43};
unsigned char RALINK_OUI[] = {0x00, 0x0c, 0x43};
unsigned char REALTEK_OUI[] = {0x00, 0xe0, 0x4c};
unsigned char AIRGOCAP_OUI[] = {0x00, 0x0a, 0xf5};
unsigned char EPIGRAM_OUI[] = {0x00, 0x90, 0x4c};
static unsigned char CISCO_OUI[] = {0x00, 0x40, 0x96};
static unsigned char MARVELL_OUI[] = {0x00, 0x50, 0x43};
static unsigned char RALINK_OUI[] = {0x00, 0x0c, 0x43};
static unsigned char REALTEK_OUI[] = {0x00, 0xe0, 0x4c};
static unsigned char AIRGOCAP_OUI[] = {0x00, 0x0a, 0xf5};
static unsigned char EPIGRAM_OUI[] = {0x00, 0x90, 0x4c};
unsigned char REALTEK_96B_IE[] = {0x00, 0xe0, 0x4c, 0x02, 0x01, 0x20};
@ -710,7 +710,7 @@ void CAM_empty_entry(
void invalidate_cam_all(_adapter *padapter)
{
rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, 0);
rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, NULL);
}
void write_cam(_adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key)
@ -826,7 +826,7 @@ void flush_all_cam_entry(_adapter *padapter)
}
#else //CONFIG_CONCURRENT_MODE
rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, 0);
rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, NULL);
#endif //CONFIG_CONCURRENT_MODE
@ -2235,10 +2235,6 @@ void update_wireless_mode(_adapter *padapter)
update_mgnt_tx_rate(padapter, IEEE80211_OFDM_RATE_6MB);
}
void fire_write_MAC_cmd(_adapter *padapter, unsigned int addr, unsigned int value)
{
}
void update_bmc_sta_support_rate(_adapter *padapter, u32 mac_id)
{
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
@ -2335,7 +2331,7 @@ void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len)
void correct_TSF(_adapter *padapter, struct mlme_ext_priv *pmlmeext)
{
rtw_hal_set_hwreg(padapter, HW_VAR_CORRECT_TSF, 0);
rtw_hal_set_hwreg(padapter, HW_VAR_CORRECT_TSF, NULL);
}
void beacon_timing_control(_adapter *padapter)

View file

@ -26,18 +26,8 @@
#include <osdep_intf.h>
#include <circ_buf.h>
#include <ip.h>
#if defined (PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
#error "Shall be Linux or Windows, but not both!\n"
#endif
#ifdef PLATFORM_WINDOWS
#include <if_ether.h>
#endif
#ifdef CONFIG_USB_HCI
#include <usb_ops.h>
#endif
#include <usb_osintf.h>
static u8 P802_1H_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0xf8 };
@ -1105,8 +1095,7 @@ _func_enter_;
SetFrameSubType(fctrl, pattrib->subtype);
if (pattrib->subtype & WIFI_DATA_TYPE)
{
if (pattrib->subtype & WIFI_DATA_TYPE) {
if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true)) {
//to_ds = 1, fr_ds = 0;
#ifdef CONFIG_TDLS
@ -1840,7 +1829,7 @@ _func_enter_;
snap->oui[1] = oui[1];
snap->oui[2] = oui[2];
*(u16 *)(data + SNAP_SIZE) = htons(h_proto);
*(__be16 *)(data + SNAP_SIZE) = htons(h_proto);
_func_exit_;
@ -2662,14 +2651,13 @@ _func_exit_;
}
#ifdef CONFIG_BR_EXT
int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb)
static int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb)
{
struct sk_buff *skb = *pskb;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
_irqL irqL;
//if (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true)
{
void dhcp_flag_bcast(_adapter *priv, struct sk_buff *skb);
int res, is_vlan_tag=0, i, do_nat25=1;
unsigned short vlan_hdr=0;
void *br_port = NULL;
@ -2687,14 +2675,14 @@ int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb)
if ( !(skb->data[0] & 1) &&
br_port &&
memcmp(skb->data+MACADDRLEN, padapter->br_mac, MACADDRLEN) &&
*((unsigned short *)(skb->data+MACADDRLEN*2)) != __constant_htons(ETH_P_8021Q) &&
*((unsigned short *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_IP) &&
*((__be16 *)(skb->data+MACADDRLEN*2)) != __constant_htons(ETH_P_8021Q) &&
*((__be16 *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_IP) &&
!memcmp(padapter->scdb_mac, skb->data+MACADDRLEN, MACADDRLEN) && padapter->scdb_entry) {
memcpy(skb->data+MACADDRLEN, GET_MY_HWADDR(padapter), MACADDRLEN);
padapter->scdb_entry->ageing_timer = jiffies;
_exit_critical_bh(&padapter->br_ext_lock, &irqL);
} else {
if (*((unsigned short *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_8021Q)) {
if (*((__be16 *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_8021Q)) {
is_vlan_tag = 1;
vlan_hdr = *((unsigned short *)(skb->data+MACADDRLEN*2+2));
for (i=0; i<6; i++)
@ -2702,13 +2690,11 @@ int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb)
skb_pull(skb, 4);
}
if (!memcmp(skb->data+MACADDRLEN, padapter->br_mac, MACADDRLEN) &&
(*((unsigned short *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_IP)))
(*((__be16 *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_IP)))
memcpy(padapter->br_ip, skb->data+WLAN_ETHHDR_LEN+12, 4);
if (*((unsigned short *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_IP)) {
if (*((__be16 *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_IP)) {
if (memcmp(padapter->scdb_mac, skb->data+MACADDRLEN, MACADDRLEN)) {
void *scdb_findEntry(_adapter *priv, unsigned char *macAddr, unsigned char *ipAddr);
if ((padapter->scdb_entry = (struct nat25_network_db_entry *)scdb_findEntry(padapter,
skb->data+MACADDRLEN, skb->data+WLAN_ETHHDR_LEN+12)) != NULL) {
memcpy(padapter->scdb_mac, skb->data+MACADDRLEN, MACADDRLEN);
@ -2728,7 +2714,6 @@ int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb)
}
_exit_critical_bh(&padapter->br_ext_lock, &irqL);
if (do_nat25) {
int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method);
if (nat25_db_handle(padapter, skb, NAT25_CHECK) == 0) {
struct sk_buff *newskb;
@ -2736,7 +2721,7 @@ int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb)
skb_push(skb, 4);
for (i=0; i<6; i++)
*((unsigned short *)(skb->data+i*2)) = *((unsigned short *)(skb->data+4+i*2));
*((unsigned short *)(skb->data+MACADDRLEN*2)) = __constant_htons(ETH_P_8021Q);
*((__be16 *)(skb->data+MACADDRLEN*2)) = __constant_htons(ETH_P_8021Q);
*((unsigned short *)(skb->data+MACADDRLEN*2+2)) = vlan_hdr;
}
@ -2797,7 +2782,7 @@ int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb)
skb_push(skb, 4);
for (i=0; i<6; i++)
*((unsigned short *)(skb->data+i*2)) = *((unsigned short *)(skb->data+4+i*2));
*((unsigned short *)(skb->data+MACADDRLEN*2)) = __constant_htons(ETH_P_8021Q);
*((__be16 *)(skb->data+MACADDRLEN*2)) = __constant_htons(ETH_P_8021Q);
*((unsigned short *)(skb->data+MACADDRLEN*2+2)) = vlan_hdr;
}
}
@ -3738,7 +3723,7 @@ int rtw_sctx_wait(struct submit_ctx *sctx)
return ret;
}
bool rtw_sctx_chk_waring_status(int status)
static bool rtw_sctx_chk_waring_status(int status)
{
switch (status) {
case RTW_SCTX_DONE_UNKNOWN:

View file

@ -60,7 +60,7 @@ CheckCondition(
* AGC_TAB_1T.TXT
******************************************************************************/
u4Byte Array_AGC_TAB_1T_8188E[] = {
static u4Byte Array_AGC_TAB_1T_8188E[] = {
0xC78, 0xFB000001,
0xC78, 0xFB010001,
0xC78, 0xFB020001,
@ -327,7 +327,7 @@ ODM_ReadAndConfig_AGC_TAB_1T_8188E(
* PHY_REG_1T.TXT
******************************************************************************/
u4Byte Array_PHY_REG_1T_8188E[] = {
static u4Byte Array_PHY_REG_1T_8188E[] = {
0x800, 0x80040000,
0x804, 0x00000003,
0x808, 0x0000FC00,
@ -737,7 +737,7 @@ ODM_ReadAndConfig_PHY_REG_1T_8188E(
* PHY_REG_PG.TXT
******************************************************************************/
u4Byte Array_PHY_REG_PG_8188E[] = {
static u4Byte Array_PHY_REG_PG_8188E[] = {
0xE00, 0xFFFFFFFF, 0x06070809,
0xE04, 0xFFFFFFFF, 0x02020405,
0xE08, 0x0000FF00, 0x00000006,

View file

@ -58,7 +58,7 @@ CheckCondition(
* MAC_REG.TXT
******************************************************************************/
u4Byte Array_MAC_REG_8188E[] = {
static u4Byte Array_MAC_REG_8188E[] = {
0x026, 0x00000041,
0x027, 0x00000035,
0x428, 0x0000000A,

View file

@ -60,7 +60,7 @@ CheckCondition(
* RadioA_1T.TXT
******************************************************************************/
u4Byte Array_RadioA_1T_8188E[] = {
static u4Byte Array_RadioA_1T_8188E[] = {
0x000, 0x00030000,
0x008, 0x00084000,
0x018, 0x00000407,

View file

@ -130,7 +130,7 @@ ODM_TxPwrTrackAdjust88E(
* 04/23/2012 MHC Create Version 0.
*
*---------------------------------------------------------------------------*/
void
static void
odm_TxPwrTrackSetPwr88E(
PDM_ODM_T pDM_Odm
)
@ -627,7 +627,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
#define MAX_TOLERANCE 5
#define IQK_DELAY_TIME 1 //ms
u1Byte //bit0 = 1 => Tx OK, bit1 = 1 => Rx OK
static u1Byte //bit0 = 1 => Tx OK, bit1 = 1 => Rx OK
phy_PathA_IQK_8188E(
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
PDM_ODM_T pDM_Odm,
@ -691,7 +691,7 @@ phy_PathA_IQK_8188E(
return result;
}
u1Byte //bit0 = 1 => Tx OK, bit1 = 1 => Rx OK
static u1Byte //bit0 = 1 => Tx OK, bit1 = 1 => Rx OK
phy_PathA_RxIQK(
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
PDM_ODM_T pDM_Odm,
@ -836,7 +836,7 @@ phy_PathA_RxIQK(
}
u1Byte //bit0 = 1 => Tx OK, bit1 = 1 => Rx OK
static u1Byte //bit0 = 1 => Tx OK, bit1 = 1 => Rx OK
phy_PathB_IQK_8188E(
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
PDM_ODM_T pDM_Odm
@ -899,7 +899,7 @@ phy_PathB_IQK_8188E(
}
void
static void
_PHY_PathAFillIQKMatrix(
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
PDM_ODM_T pDM_Odm,
@ -974,7 +974,7 @@ _PHY_PathAFillIQKMatrix(
}
}
void
static void
_PHY_PathBFillIQKMatrix(
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
PDM_ODM_T pDM_Odm,
@ -1046,7 +1046,7 @@ _PHY_PathBFillIQKMatrix(
//
// MP Already declare in odm.c
#if !(DM_ODM_SUPPORT_TYPE & ODM_MP)
bool
static bool
ODM_CheckPowerStatus(
PADAPTER Adapter)
{
@ -1111,8 +1111,7 @@ _PHY_SaveADDARegisters(
}
void
_PHY_SaveMACRegisters(
static void _PHY_SaveMACRegisters(
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
PDM_ODM_T pDM_Odm,
#else
@ -1141,7 +1140,7 @@ _PHY_SaveMACRegisters(
}
void
static void
_PHY_ReloadADDARegisters(
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
PDM_ODM_T pDM_Odm,
@ -1171,7 +1170,7 @@ _PHY_ReloadADDARegisters(
}
}
void
static void
_PHY_ReloadMACRegisters(
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
PDM_ODM_T pDM_Odm,
@ -1297,8 +1296,7 @@ _PHY_PathAStandBy(
ODM_SetBBReg(pDM_Odm, rFPGA0_IQK, bMaskDWord, 0x80800000);
}
void
_PHY_PIModeSwitch(
static void _PHY_PIModeSwitch(
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
PDM_ODM_T pDM_Odm,
#else
@ -1324,8 +1322,7 @@ _PHY_PIModeSwitch(
ODM_SetBBReg(pDM_Odm, rFPGA0_XB_HSSIParameter1, bMaskDWord, mode);
}
bool
phy_SimularityCompare_8188E(
static bool phy_SimularityCompare_8188E(
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
PDM_ODM_T pDM_Odm,
#else
@ -1457,10 +1454,7 @@ phy_SimularityCompare_8188E(
}
void
phy_IQCalibrate_8188E(
static void phy_IQCalibrate_8188E(
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
PDM_ODM_T pDM_Odm,
#else
@ -1519,8 +1513,6 @@ else
// Note: IQ calibration must be performed after loading
// PHY_REG.txt , and radio_a, radio_b.txt
//u4Byte bbvalue;
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#ifdef MP_TEST
if (pDM_Odm->priv->pshare->rf_ft_var.mp_specific)
@ -1529,12 +1521,8 @@ else
#endif
if (t==0)
{
// bbvalue = ODM_GetBBReg(pDM_Odm, rFPGA0_RFMOD, bMaskDWord);
// RTPRINT(FINIT, INIT_IQK, ("phy_IQCalibrate_8188E()==>0x%08x\n",bbvalue));
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQ Calibration for %s for %d times\n", (is2T ? "2T2R" : "1T1R"), t));
if (t==0) {
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQ Calibration for %s for %d times\n", (is2T ? "2T2R" : "1T1R"), t));
// Save ADDA parameters, turn Path A ADDA on
#if !(DM_ODM_SUPPORT_TYPE & ODM_AP)
@ -1550,17 +1538,12 @@ else
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQ Calibration for %s for %d times\n", (is2T ? "2T2R" : "1T1R"), t));
#if !(DM_ODM_SUPPORT_TYPE & ODM_AP)
_PHY_PathADDAOn(pAdapter, ADDA_REG, true, is2T);
#else
_PHY_PathADDAOn(pDM_Odm, ADDA_REG, true, is2T);
#endif
if (t==0)
{
pDM_Odm->RFCalibrateInfo.bRfPiEnable = (u1Byte)ODM_GetBBReg(pDM_Odm, rFPGA0_XA_HSSIParameter1, BIT(8));
}
if (!pDM_Odm->RFCalibrateInfo.bRfPiEnable){
// Switch BB to PI mode to do IQ Calibration.
@ -1739,8 +1722,7 @@ else
}
void
phy_LCCalibrate_8188E(
static void phy_LCCalibrate_8188E(
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
PDM_ODM_T pDM_Odm,
#else
@ -1830,8 +1812,7 @@ phy_LCCalibrate_8188E(
#define APK_CURVE_REG_NUM 4
#define PATH_NUM 2
void
phy_APCalibrate_8188E(
static void phy_APCalibrate_8188E(
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
PDM_ODM_T pDM_Odm,
#else
@ -2729,7 +2710,8 @@ PHY_APCalibrate_8188E(
#endif
}
}
void phy_SetRFPathSwitch_8188E(
static void phy_SetRFPathSwitch_8188E(
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
PDM_ODM_T pDM_Odm,
#else

247
hal/odm.c
View file

@ -24,17 +24,16 @@
#include "odm_precomp.h"
const u2Byte dB_Invert_Table[8][12] = {
{ 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4},
{ 4, 5, 6, 6, 7, 8, 9, 10, 11, 13, 14, 16},
{ 18, 20, 22, 25, 28, 32, 35, 40, 45, 50, 56, 63},
{ 71, 79, 89, 100, 112, 126, 141, 158, 178, 200, 224, 251},
{ 282, 316, 355, 398, 447, 501, 562, 631, 708, 794, 891, 1000},
{ 1122, 1259, 1413, 1585, 1778, 1995, 2239, 2512, 2818, 3162, 3548, 3981},
{ 4467, 5012, 5623, 6310, 7079, 7943, 8913, 10000, 11220, 12589, 14125, 15849},
{ 17783, 19953, 22387, 25119, 28184, 31623, 35481, 39811, 44668, 50119, 56234, 65535}};
static const u2Byte dB_Invert_Table[8][12] = {
{1,1,1, 2, 2, 2, 2, 3, 3, 3, 4, 4},
{4, 5, 6, 6, 7, 8, 9, 10, 11, 13, 14, 16},
{18, 20, 22, 25, 28, 32, 35, 40, 45, 50, 56, 63},
{71, 79, 89, 100, 112, 126, 141, 158, 178, 200, 224, 251},
{282, 316, 355, 398, 447, 501, 562, 631, 708, 794, 891, 1000},
{1122, 1259, 1413, 1585, 1778, 1995, 2239, 2512, 2818, 3162, 3548, 3981},
{4467, 5012, 5623, 6310, 7079, 7943, 8913, 10000, 11220, 12589, 14125, 15849},
{17783, 19953, 22387, 25119, 28184, 31623, 35481, 39811, 44668, 50119, 56234, 65535}
};
// 20100515 Joseph: Add global variable to keep temporary scan list for antenna switching test.
//u1Byte tmpNumBssDesc;
@ -43,16 +42,16 @@ const u2Byte dB_Invert_Table[8][12] = {
#if (DM_ODM_SUPPORT_TYPE==ODM_MP)
static u4Byte edca_setting_UL[HT_IOT_PEER_MAX] =
// UNKNOWN REALTEK_90 REALTEK_92SE BROADCOM RALINK ATHEROS CISCO MARVELL 92U_AP SELF_AP(DownLink/Tx)
{ 0x5e4322, 0xa44f, 0x5e4322, 0x5ea32b, 0x5ea422, 0x5ea322, 0x3ea430, 0x5ea44f, 0x5e4322, 0x5e4322};
{ 0x5e4322, 0xa44f, 0x5e4322, 0x5ea32b, 0x5ea422, 0x5ea322, 0x3ea430, 0x5ea44f, 0x5e4322, 0x5e4322};
static u4Byte edca_setting_DL[HT_IOT_PEER_MAX] =
// UNKNOWN REALTEK_90 REALTEK_92SE BROADCOM RALINK ATHEROS CISCO MARVELL 92U_AP SELF_AP(UpLink/Rx)
{ 0xa44f, 0x5ea44f, 0x5e4322, 0x5ea42b, 0xa44f, 0xa630, 0x5ea630, 0xa44f, 0xa42b, 0xa42b};
{ 0xa44f, 0x5ea44f, 0x5e4322, 0x5ea42b, 0xa44f, 0xa630, 0x5ea630, 0xa44f, 0xa42b, 0xa42b};
static u4Byte edca_setting_DL_GMode[HT_IOT_PEER_MAX] =
// UNKNOWN REALTEK_90 REALTEK_92SE BROADCOM RALINK ATHEROS CISCO MARVELL 92U_AP SELF_AP
{ 0x4322, 0xa44f, 0x5e4322, 0xa42b, 0x5e4322, 0x4322, 0xa42b, 0xa44f, 0x5e4322, 0x5ea42b};
{ 0x4322, 0xa44f, 0x5e4322, 0xa42b, 0x5e4322, 0x4322, 0xa42b, 0xa44f, 0x5e4322, 0x5ea42b};
//============================================================
@ -60,7 +59,7 @@ static u4Byte edca_setting_DL_GMode[HT_IOT_PEER_MAX] =
//avoid to warn in FreeBSD ==> To DO modify
u4Byte EDCAParam[HT_IOT_PEER_MAX][3] =
static u4Byte EDCAParam[HT_IOT_PEER_MAX][3] =
{ // UL DL
{0x5ea42b, 0x5ea42b, 0x5ea42b}, //0:unknown AP
{0xa44f, 0x5ea44f, 0x5e431c}, // 1:realtek AP
@ -68,15 +67,12 @@ u4Byte EDCAParam[HT_IOT_PEER_MAX][3] =
{0x5ea32b, 0x5ea42b, 0x5e4322}, // 3:broadcom AP
{0x5ea422, 0x00a44f, 0x00a44f}, // 4:ralink AP
{0x5ea322, 0x00a630, 0x00a44f}, // 5:atheros AP
//{0x5ea42b, 0x5ea42b, 0x5ea42b},// 6:cisco AP
{0x5e4322, 0x5e4322, 0x5e4322},// 6:cisco AP
//{0x3ea430, 0x00a630, 0x3ea44f}, // 7:cisco AP
{0x5ea44f, 0x00a44f, 0x5ea42b}, // 8:marvell AP
//{0x5ea44f, 0x5ea44f, 0x5ea44f}, // 9realtek AP
{0x5ea42b, 0x5ea42b, 0x5ea42b}, // 10:unknown AP=> 92U AP
{0x5ea42b, 0xa630, 0x5e431c}, // 11:airgocap AP
// {0x5e4322, 0x00a44f, 0x5ea44f}, // 12:unknown AP
};
//============================================================
// EDCA Paramter for AP/ADSL by Mingzhi 2011-11-22
//============================================================
@ -157,75 +153,75 @@ u4Byte OFDMSwingTable[OFDM_TABLE_SIZE_92D] = {
u1Byte CCKSwingTable_Ch1_Ch13[CCK_TABLE_SIZE][8] = {
{0x36, 0x35, 0x2e, 0x25, 0x1c, 0x12, 0x09, 0x04}, // 0, +0dB
{0x33, 0x32, 0x2b, 0x23, 0x1a, 0x11, 0x08, 0x04}, // 1, -0.5dB
{0x30, 0x2f, 0x29, 0x21, 0x19, 0x10, 0x08, 0x03}, // 2, -1.0dB
{0x2d, 0x2d, 0x27, 0x1f, 0x18, 0x0f, 0x08, 0x03}, // 3, -1.5dB
{0x2b, 0x2a, 0x25, 0x1e, 0x16, 0x0e, 0x07, 0x03}, // 4, -2.0dB
{0x28, 0x28, 0x22, 0x1c, 0x15, 0x0d, 0x07, 0x03}, // 5, -2.5dB
{0x26, 0x25, 0x21, 0x1b, 0x14, 0x0d, 0x06, 0x03}, // 6, -3.0dB
{0x24, 0x23, 0x1f, 0x19, 0x13, 0x0c, 0x06, 0x03}, // 7, -3.5dB
{0x22, 0x21, 0x1d, 0x18, 0x11, 0x0b, 0x06, 0x02}, // 8, -4.0dB
{0x20, 0x20, 0x1b, 0x16, 0x11, 0x08, 0x05, 0x02}, // 9, -4.5dB
{0x1f, 0x1e, 0x1a, 0x15, 0x10, 0x0a, 0x05, 0x02}, // 10, -5.0dB
{0x1d, 0x1c, 0x18, 0x14, 0x0f, 0x0a, 0x05, 0x02}, // 11, -5.5dB
{0x1b, 0x1a, 0x17, 0x13, 0x0e, 0x09, 0x04, 0x02}, // 12, -6.0dB
{0x1a, 0x19, 0x16, 0x12, 0x0d, 0x09, 0x04, 0x02}, // 13, -6.5dB
{0x18, 0x17, 0x15, 0x11, 0x0c, 0x08, 0x04, 0x02}, // 14, -7.0dB
{0x17, 0x16, 0x13, 0x10, 0x0c, 0x08, 0x04, 0x02}, // 15, -7.5dB
{0x16, 0x15, 0x12, 0x0f, 0x0b, 0x07, 0x04, 0x01}, // 16, -8.0dB
{0x14, 0x14, 0x11, 0x0e, 0x0b, 0x07, 0x03, 0x02}, // 17, -8.5dB
{0x13, 0x13, 0x10, 0x0d, 0x0a, 0x06, 0x03, 0x01}, // 18, -9.0dB
{0x12, 0x12, 0x0f, 0x0c, 0x09, 0x06, 0x03, 0x01}, // 19, -9.5dB
{0x11, 0x11, 0x0f, 0x0c, 0x09, 0x06, 0x03, 0x01}, // 20, -10.0dB
{0x10, 0x10, 0x0e, 0x0b, 0x08, 0x05, 0x03, 0x01}, // 21, -10.5dB
{0x0f, 0x0f, 0x0d, 0x0b, 0x08, 0x05, 0x03, 0x01}, // 22, -11.0dB
{0x0e, 0x0e, 0x0c, 0x0a, 0x08, 0x05, 0x02, 0x01}, // 23, -11.5dB
{0x0d, 0x0d, 0x0c, 0x0a, 0x07, 0x05, 0x02, 0x01}, // 24, -12.0dB
{0x0d, 0x0c, 0x0b, 0x09, 0x07, 0x04, 0x02, 0x01}, // 25, -12.5dB
{0x0c, 0x0c, 0x0a, 0x09, 0x06, 0x04, 0x02, 0x01}, // 26, -13.0dB
{0x0b, 0x0b, 0x0a, 0x08, 0x06, 0x04, 0x02, 0x01}, // 27, -13.5dB
{0x0b, 0x0a, 0x09, 0x08, 0x06, 0x04, 0x02, 0x01}, // 28, -14.0dB
{0x0a, 0x0a, 0x09, 0x07, 0x05, 0x03, 0x02, 0x01}, // 29, -14.5dB
{0x0a, 0x09, 0x08, 0x07, 0x05, 0x03, 0x02, 0x01}, // 30, -15.0dB
{0x09, 0x09, 0x08, 0x06, 0x05, 0x03, 0x01, 0x01}, // 31, -15.5dB
{0x36, 0x35, 0x2e, 0x25, 0x1c, 0x12, 0x09, 0x04}, // 0, +0dB
{0x33, 0x32, 0x2b, 0x23, 0x1a, 0x11, 0x08, 0x04}, // 1, -0.5dB
{0x30, 0x2f, 0x29, 0x21, 0x19, 0x10, 0x08, 0x03}, // 2, -1.0dB
{0x2d, 0x2d, 0x27, 0x1f, 0x18, 0x0f, 0x08, 0x03}, // 3, -1.5dB
{0x2b, 0x2a, 0x25, 0x1e, 0x16, 0x0e, 0x07, 0x03}, // 4, -2.0dB
{0x28, 0x28, 0x22, 0x1c, 0x15, 0x0d, 0x07, 0x03}, // 5, -2.5dB
{0x26, 0x25, 0x21, 0x1b, 0x14, 0x0d, 0x06, 0x03}, // 6, -3.0dB
{0x24, 0x23, 0x1f, 0x19, 0x13, 0x0c, 0x06, 0x03}, // 7, -3.5dB
{0x22, 0x21, 0x1d, 0x18, 0x11, 0x0b, 0x06, 0x02}, // 8, -4.0dB
{0x20, 0x20, 0x1b, 0x16, 0x11, 0x08, 0x05, 0x02}, // 9, -4.5dB
{0x1f, 0x1e, 0x1a, 0x15, 0x10, 0x0a, 0x05, 0x02}, // 10, -5.0dB
{0x1d, 0x1c, 0x18, 0x14, 0x0f, 0x0a, 0x05, 0x02}, // 11, -5.5dB
{0x1b, 0x1a, 0x17, 0x13, 0x0e, 0x09, 0x04, 0x02}, // 12, -6.0dB
{0x1a, 0x19, 0x16, 0x12, 0x0d, 0x09, 0x04, 0x02}, // 13, -6.5dB
{0x18, 0x17, 0x15, 0x11, 0x0c, 0x08, 0x04, 0x02}, // 14, -7.0dB
{0x17, 0x16, 0x13, 0x10, 0x0c, 0x08, 0x04, 0x02}, // 15, -7.5dB
{0x16, 0x15, 0x12, 0x0f, 0x0b, 0x07, 0x04, 0x01}, // 16, -8.0dB
{0x14, 0x14, 0x11, 0x0e, 0x0b, 0x07, 0x03, 0x02}, // 17, -8.5dB
{0x13, 0x13, 0x10, 0x0d, 0x0a, 0x06, 0x03, 0x01}, // 18, -9.0dB
{0x12, 0x12, 0x0f, 0x0c, 0x09, 0x06, 0x03, 0x01}, // 19, -9.5dB
{0x11, 0x11, 0x0f, 0x0c, 0x09, 0x06, 0x03, 0x01}, // 20, -10.0dB
{0x10, 0x10, 0x0e, 0x0b, 0x08, 0x05, 0x03, 0x01}, // 21, -10.5dB
{0x0f, 0x0f, 0x0d, 0x0b, 0x08, 0x05, 0x03, 0x01}, // 22, -11.0dB
{0x0e, 0x0e, 0x0c, 0x0a, 0x08, 0x05, 0x02, 0x01}, // 23, -11.5dB
{0x0d, 0x0d, 0x0c, 0x0a, 0x07, 0x05, 0x02, 0x01}, // 24, -12.0dB
{0x0d, 0x0c, 0x0b, 0x09, 0x07, 0x04, 0x02, 0x01}, // 25, -12.5dB
{0x0c, 0x0c, 0x0a, 0x09, 0x06, 0x04, 0x02, 0x01}, // 26, -13.0dB
{0x0b, 0x0b, 0x0a, 0x08, 0x06, 0x04, 0x02, 0x01}, // 27, -13.5dB
{0x0b, 0x0a, 0x09, 0x08, 0x06, 0x04, 0x02, 0x01}, // 28, -14.0dB
{0x0a, 0x0a, 0x09, 0x07, 0x05, 0x03, 0x02, 0x01}, // 29, -14.5dB
{0x0a, 0x09, 0x08, 0x07, 0x05, 0x03, 0x02, 0x01}, // 30, -15.0dB
{0x09, 0x09, 0x08, 0x06, 0x05, 0x03, 0x01, 0x01}, // 31, -15.5dB
{0x09, 0x08, 0x07, 0x06, 0x04, 0x03, 0x01, 0x01} // 32, -16.0dB
};
u1Byte CCKSwingTable_Ch14 [CCK_TABLE_SIZE][8]= {
{0x36, 0x35, 0x2e, 0x1b, 0x00, 0x00, 0x00, 0x00}, // 0, +0dB
{0x33, 0x32, 0x2b, 0x19, 0x00, 0x00, 0x00, 0x00}, // 1, -0.5dB
{0x30, 0x2f, 0x29, 0x18, 0x00, 0x00, 0x00, 0x00}, // 2, -1.0dB
{0x2d, 0x2d, 0x17, 0x17, 0x00, 0x00, 0x00, 0x00}, // 3, -1.5dB
{0x2b, 0x2a, 0x25, 0x15, 0x00, 0x00, 0x00, 0x00}, // 4, -2.0dB
{0x28, 0x28, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00}, // 5, -2.5dB
{0x26, 0x25, 0x21, 0x13, 0x00, 0x00, 0x00, 0x00}, // 6, -3.0dB
{0x24, 0x23, 0x1f, 0x12, 0x00, 0x00, 0x00, 0x00}, // 7, -3.5dB
{0x22, 0x21, 0x1d, 0x11, 0x00, 0x00, 0x00, 0x00}, // 8, -4.0dB
{0x20, 0x20, 0x1b, 0x10, 0x00, 0x00, 0x00, 0x00}, // 9, -4.5dB
{0x1f, 0x1e, 0x1a, 0x0f, 0x00, 0x00, 0x00, 0x00}, // 10, -5.0dB
{0x1d, 0x1c, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00}, // 11, -5.5dB
{0x1b, 0x1a, 0x17, 0x0e, 0x00, 0x00, 0x00, 0x00}, // 12, -6.0dB
{0x1a, 0x19, 0x16, 0x0d, 0x00, 0x00, 0x00, 0x00}, // 13, -6.5dB
{0x18, 0x17, 0x15, 0x0c, 0x00, 0x00, 0x00, 0x00}, // 14, -7.0dB
{0x17, 0x16, 0x13, 0x0b, 0x00, 0x00, 0x00, 0x00}, // 15, -7.5dB
{0x16, 0x15, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00}, // 16, -8.0dB
{0x14, 0x14, 0x11, 0x0a, 0x00, 0x00, 0x00, 0x00}, // 17, -8.5dB
{0x13, 0x13, 0x10, 0x0a, 0x00, 0x00, 0x00, 0x00}, // 18, -9.0dB
{0x12, 0x12, 0x0f, 0x09, 0x00, 0x00, 0x00, 0x00}, // 19, -9.5dB
{0x11, 0x11, 0x0f, 0x09, 0x00, 0x00, 0x00, 0x00}, // 20, -10.0dB
{0x10, 0x10, 0x0e, 0x08, 0x00, 0x00, 0x00, 0x00}, // 21, -10.5dB
{0x0f, 0x0f, 0x0d, 0x08, 0x00, 0x00, 0x00, 0x00}, // 22, -11.0dB
{0x0e, 0x0e, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00}, // 23, -11.5dB
{0x0d, 0x0d, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00}, // 24, -12.0dB
{0x0d, 0x0c, 0x0b, 0x06, 0x00, 0x00, 0x00, 0x00}, // 25, -12.5dB
{0x0c, 0x0c, 0x0a, 0x06, 0x00, 0x00, 0x00, 0x00}, // 26, -13.0dB
{0x0b, 0x0b, 0x0a, 0x06, 0x00, 0x00, 0x00, 0x00}, // 27, -13.5dB
{0x0b, 0x0a, 0x09, 0x05, 0x00, 0x00, 0x00, 0x00}, // 28, -14.0dB
{0x0a, 0x0a, 0x09, 0x05, 0x00, 0x00, 0x00, 0x00}, // 29, -14.5dB
{0x0a, 0x09, 0x08, 0x05, 0x00, 0x00, 0x00, 0x00}, // 30, -15.0dB
{0x09, 0x09, 0x08, 0x05, 0x00, 0x00, 0x00, 0x00}, // 31, -15.5dB
{0x36, 0x35, 0x2e, 0x1b, 0x00, 0x00, 0x00, 0x00}, // 0, +0dB
{0x33, 0x32, 0x2b, 0x19, 0x00, 0x00, 0x00, 0x00}, // 1, -0.5dB
{0x30, 0x2f, 0x29, 0x18, 0x00, 0x00, 0x00, 0x00}, // 2, -1.0dB
{0x2d, 0x2d, 0x17, 0x17, 0x00, 0x00, 0x00, 0x00}, // 3, -1.5dB
{0x2b, 0x2a, 0x25, 0x15, 0x00, 0x00, 0x00, 0x00}, // 4, -2.0dB
{0x28, 0x28, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00}, // 5, -2.5dB
{0x26, 0x25, 0x21, 0x13, 0x00, 0x00, 0x00, 0x00}, // 6, -3.0dB
{0x24, 0x23, 0x1f, 0x12, 0x00, 0x00, 0x00, 0x00}, // 7, -3.5dB
{0x22, 0x21, 0x1d, 0x11, 0x00, 0x00, 0x00, 0x00}, // 8, -4.0dB
{0x20, 0x20, 0x1b, 0x10, 0x00, 0x00, 0x00, 0x00}, // 9, -4.5dB
{0x1f, 0x1e, 0x1a, 0x0f, 0x00, 0x00, 0x00, 0x00}, // 10, -5.0dB
{0x1d, 0x1c, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00}, // 11, -5.5dB
{0x1b, 0x1a, 0x17, 0x0e, 0x00, 0x00, 0x00, 0x00}, // 12, -6.0dB
{0x1a, 0x19, 0x16, 0x0d, 0x00, 0x00, 0x00, 0x00}, // 13, -6.5dB
{0x18, 0x17, 0x15, 0x0c, 0x00, 0x00, 0x00, 0x00}, // 14, -7.0dB
{0x17, 0x16, 0x13, 0x0b, 0x00, 0x00, 0x00, 0x00}, // 15, -7.5dB
{0x16, 0x15, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00}, // 16, -8.0dB
{0x14, 0x14, 0x11, 0x0a, 0x00, 0x00, 0x00, 0x00}, // 17, -8.5dB
{0x13, 0x13, 0x10, 0x0a, 0x00, 0x00, 0x00, 0x00}, // 18, -9.0dB
{0x12, 0x12, 0x0f, 0x09, 0x00, 0x00, 0x00, 0x00}, // 19, -9.5dB
{0x11, 0x11, 0x0f, 0x09, 0x00, 0x00, 0x00, 0x00}, // 20, -10.0dB
{0x10, 0x10, 0x0e, 0x08, 0x00, 0x00, 0x00, 0x00}, // 21, -10.5dB
{0x0f, 0x0f, 0x0d, 0x08, 0x00, 0x00, 0x00, 0x00}, // 22, -11.0dB
{0x0e, 0x0e, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00}, // 23, -11.5dB
{0x0d, 0x0d, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00}, // 24, -12.0dB
{0x0d, 0x0c, 0x0b, 0x06, 0x00, 0x00, 0x00, 0x00}, // 25, -12.5dB
{0x0c, 0x0c, 0x0a, 0x06, 0x00, 0x00, 0x00, 0x00}, // 26, -13.0dB
{0x0b, 0x0b, 0x0a, 0x06, 0x00, 0x00, 0x00, 0x00}, // 27, -13.5dB
{0x0b, 0x0a, 0x09, 0x05, 0x00, 0x00, 0x00, 0x00}, // 28, -14.0dB
{0x0a, 0x0a, 0x09, 0x05, 0x00, 0x00, 0x00, 0x00}, // 29, -14.5dB
{0x0a, 0x09, 0x08, 0x05, 0x00, 0x00, 0x00, 0x00}, // 30, -15.0dB
{0x09, 0x09, 0x08, 0x05, 0x00, 0x00, 0x00, 0x00}, // 31, -15.5dB
{0x09, 0x08, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00} // 32, -16.0dB
};
@ -385,7 +381,7 @@ odm_PathDivChkAntSwitchWorkitemCallback(
void * pContext
);
void odm_SetRespPath_92C( PADAPTER Adapter, u1Byte DefaultRespPath);
void odm_SetRespPath_92C( PADAPTER Adapter, u1Byte DefaultRespPath);
void odm_OFDMTXPathDiversity_92C( PADAPTER Adapter);
void odm_CCKTXPathDiversity_92C( PADAPTER Adapter);
void odm_ResetPathDiversity_92C( PADAPTER Adapter);
@ -1473,8 +1469,7 @@ odm_IsLinked(
* When Who Remark
*
*---------------------------------------------------------------------------*/
void
ODM_ChangeDynamicInitGainThresh(
static void ODM_ChangeDynamicInitGainThresh(
PDM_ODM_T pDM_Odm,
u4Byte DM_Type,
u4Byte DM_Value
@ -1518,7 +1513,7 @@ ODM_ChangeDynamicInitGainThresh(
}
} /* DM_ChangeDynamicInitGainThresh */
int getIGIForDiff(int value_IGI)
static int getIGIForDiff(int value_IGI)
{
#define ONERCCA_LOW_TH 0x30
#define ONERCCA_LOW_DIFF 8
@ -2112,7 +2107,7 @@ odm_DIG(
if (FirstConnect)
{
CurrentIGI = pDM_Odm->RSSI_Min;
ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("DIG: First Connect\n"));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("DIG: First Connect\n"));
}
else
{
@ -2423,9 +2418,9 @@ odm_FalseAlarmCounterStatistics(
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11AC, BIT15, 0);
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_FA_RST_11AC, BIT15, 1);
}
ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Cck_fail=%d\n", FalseAlmCnt->Cnt_Cck_fail));
ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Ofdm_fail=%d\n", FalseAlmCnt->Cnt_Ofdm_fail));
ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Total False Alarm=%d\n", FalseAlmCnt->Cnt_all));
ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Cck_fail=%d\n", FalseAlmCnt->Cnt_Cck_fail));
ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Cnt_Ofdm_fail=%d\n", FalseAlmCnt->Cnt_Ofdm_fail));
ODM_RT_TRACE(pDM_Odm,ODM_COMP_FA_CNT, ODM_DBG_LOUD, ("Total False Alarm=%d\n", FalseAlmCnt->Cnt_all));
}
//3============================================================
@ -2611,7 +2606,7 @@ odm_1R_CCA(
}
pDM_PSTable->PreCCAState = pDM_PSTable->CurCCAState;
}
//ODM_RT_TRACE(pDM_Odm, COMP_BB_POWERSAVING, DBG_LOUD, ("CCAStage = %s\n",(pDM_PSTable->CurCCAState==0)?"1RCCA":"2RCCA"));
//ODM_RT_TRACE(pDM_Odm, COMP_BB_POWERSAVING, DBG_LOUD, ("CCAStage = %s\n",(pDM_PSTable->CurCCAState==0)?"1RCCA":"2RCCA"));
}
void
@ -2684,7 +2679,7 @@ ODM_RF_Saving(
ODM_SetBBReg(pDM_Odm, 0xa74, 0xF000, 0x3); //RegA75[7:4]=0x3
ODM_SetBBReg(pDM_Odm, 0x818, BIT28, 0x0); //Reg818[28]=1'b0
ODM_SetBBReg(pDM_Odm, 0x818, BIT28, 0x1); //Reg818[28]=1'b1
//ODM_RT_TRACE(pDM_Odm, COMP_BB_POWERSAVING, DBG_LOUD, (" RF_Save"));
//ODM_RT_TRACE(pDM_Odm, COMP_BB_POWERSAVING, DBG_LOUD, (" RF_Save"));
}
else
{
@ -2698,7 +2693,7 @@ ODM_RF_Saving(
{
ODM_SetBBReg(pDM_Odm,0x874 , BIT5, 0x0); //Reg874[5]=1b'0
}
//ODM_RT_TRACE(pDM_Odm, COMP_BB_POWERSAVING, DBG_LOUD, (" RF_Normal"));
//ODM_RT_TRACE(pDM_Odm, COMP_BB_POWERSAVING, DBG_LOUD, (" RF_Normal"));
}
pDM_PSTable->PreRFState =pDM_PSTable->CurRFState;
}
@ -4749,7 +4744,7 @@ odm_SwAntDivInit_NIC(
// 20100514 Joseph:
// Add new function to reset the state of antenna diversity before link.
//
void
static void
ODM_SwAntDivResetBeforeLink(
PDM_ODM_T pDM_Odm
)
@ -5473,7 +5468,10 @@ void odm_SwAntDivChkAntSwitch(
PDM_ODM_T pDM_Odm,
u1Byte Step
) {}
void ODM_SwAntDivResetBeforeLink( PDM_ODM_T pDM_Odm ){}
static void ODM_SwAntDivResetBeforeLink(PDM_ODM_T pDM_Odm)
{
}
void ODM_SwAntDivRestAfterLink( PDM_ODM_T pDM_Odm ){}
#if (DM_ODM_SUPPORT_TYPE == ODM_MP)
u1Byte odm_SwAntDivSelectChkChnl( PADAPTER Adapter ){ return 0;}
@ -5720,8 +5718,7 @@ ODM_SwAntDivCheckBeforeLink8192C(
//3============================================================
#if (defined(CONFIG_HW_ANTENNA_DIVERSITY))
void
odm_InitHybridAntDiv_88C_92D(
static void odm_InitHybridAntDiv_88C_92D(
PDM_ODM_T pDM_Odm
)
{
@ -5964,8 +5961,7 @@ ODM_AntselStatistics_88C(
#if (DM_ODM_SUPPORT_TYPE==ODM_MP)
void
ODM_SetTxAntByTxInfo_88C_92D(
static void ODM_SetTxAntByTxInfo_88C_92D(
PDM_ODM_T pDM_Odm,
pu1Byte pDesc,
u1Byte macId
@ -5987,7 +5983,7 @@ ODM_SetTxAntByTxInfo_88C_92D(
//ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV,ODM_DBG_LOUD,("SET_TX_DESC_ANTSEL_A_92C=%d\n", pDM_SWAT_Table->TxAnt[macId]));
}
#elif (DM_ODM_SUPPORT_TYPE==ODM_CE)
void
static void
ODM_SetTxAntByTxInfo_88C_92D(
PDM_ODM_T pDM_Odm
)
@ -6004,10 +6000,7 @@ ODM_SetTxAntByTxInfo_88C_92D(
}
#endif
void
odm_HwAntDiv_92C_92D(
PDM_ODM_T pDM_Odm
)
static void odm_HwAntDiv_92C_92D(PDM_ODM_T pDM_Odm)
{
SWAT_T *pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table;
u4Byte RSSI_Min=0xFF, RSSI, RSSI_Ant1, RSSI_Ant2;
@ -8251,7 +8244,7 @@ odm_PSD_Monitor(
//2???
Is40MHz = pMgntInfo->pHTInfo->bCurBW40MHz;
ODM_RT_TRACE(pDM_Odm, COMP_PSD, DBG_LOUD,("PSD Scan Start\n"));
ODM_RT_TRACE(pDM_Odm, COMP_PSD, DBG_LOUD,("PSD Scan Start\n"));
//1 Turn off CCK
ODM_SetBBReg(pDM_Odm, rFPGA0_RFMOD, BIT24, 0);
//1 Turn off TX
@ -8862,7 +8855,7 @@ void odm_RXHP(
else
pRX_HP_Table->TP_Mode = High_TP_Mode;
ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RX HP TP Mode = %d\n", pRX_HP_Table->TP_Mode));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RX HP TP Mode = %d\n", pRX_HP_Table->TP_Mode));
// Since TP result would be sampled every 2 sec, it needs to delay 4sec to wait PSD processing.
// When LatchCnt = 0, we would Get PSD result.
if (TP_Degrade_flag == 1)
@ -8894,11 +8887,11 @@ void odm_RXHP(
Is40MHz = *(pDM_Odm->pBandWidth);
curRssi = pDM_Odm->RSSI_Min;
cur_channel = ODM_GetRFReg(pDM_Odm, RF_PATH_A, RF_CHNLBW, 0x0fff) & 0x0f;
ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RXHP RX HP flag = %d\n", pRX_HP_Table->RXHP_flag));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RXHP FA = %d\n", FalseAlmCnt->Cnt_all));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RXHP cur RSSI = %d, pre RSSI=%d\n", curRssi, preRssi));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RXHP current CH = %d\n", cur_channel));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RXHP Is 40MHz = %d\n", Is40MHz));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RXHP RX HP flag = %d\n", pRX_HP_Table->RXHP_flag));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RXHP FA = %d\n", FalseAlmCnt->Cnt_all));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RXHP cur RSSI = %d, pre RSSI=%d\n", curRssi, preRssi));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RXHP current CH = %d\n", cur_channel));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RXHP Is 40MHz = %d\n", Is40MHz));
//2 PSD function would be triggered
//3 1. Every 4 sec for PCIE
//3 2. Before TP Mode (Idle TP<4kbps) for USB
@ -9026,7 +9019,7 @@ void odm_RXHP(
}
}
#endif
ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RX HP psd_intf_flag = %d\n", psd_intf_flag));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RX HP psd_intf_flag = %d\n", psd_intf_flag));
//2 Distance between target channel and interference
for (i = 0; i < 16; i++)
{
@ -9037,7 +9030,7 @@ void odm_RXHP(
MIN_Intf_diff_idx = Intf_diff_idx; // the min difference index between interference and target
}
}
ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RX HP MIN_Intf_diff_idx = %d\n", MIN_Intf_diff_idx));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RX HP MIN_Intf_diff_idx = %d\n", MIN_Intf_diff_idx));
//2 Choose False Alarm Threshold
switch (MIN_Intf_diff_idx){
case 0:
@ -9067,7 +9060,7 @@ void odm_RXHP(
FA_TH = FA_RXHP_TH5;
break;
}
ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RX HP FA_TH = %d\n", FA_TH));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_RXHP, ODM_DBG_LOUD, ("RX HP FA_TH = %d\n", FA_TH));
pRX_HP_Table->PSD_func_trigger = 0;
}
//1 Monitor RSSI variation to choose the suitable IGI or Exit AGC RX High Power Mode
@ -9244,7 +9237,7 @@ odm_PSD_RXHP(
RXIQI = ODM_GetBBReg(pDM_Odm, 0xC14, bMaskDWord);
RxIdleLowPwr = (ODM_GetBBReg(pDM_Odm, 0x818, bMaskDWord)&BIT28)>>28;
Is40MHz = *(pDM_Odm->pBandWidth);
ODM_RT_TRACE(pDM_Odm, COMP_PSD, DBG_LOUD,("PSD Scan Start\n"));
ODM_RT_TRACE(pDM_Odm, COMP_PSD, DBG_LOUD,("PSD Scan Start\n"));
//1 Turn off CCK
ODM_SetBBReg(pDM_Odm, rFPGA0_RFMOD, BIT24, 0);
//1 Turn off TX
@ -10944,10 +10937,7 @@ ODM_SingleDualAntennaDefaultSetting(
//2 8723A ANT DETECT
void
odm_PHY_SaveAFERegisters(
PDM_ODM_T pDM_Odm,
static void odm_PHY_SaveAFERegisters(PDM_ODM_T pDM_Odm,
pu4Byte AFEReg,
pu4Byte AFEBackup,
u4Byte RegisterNum
@ -10961,8 +10951,7 @@ odm_PHY_SaveAFERegisters(
}
}
void
odm_PHY_ReloadAFERegisters(
static void odm_PHY_ReloadAFERegisters(
PDM_ODM_T pDM_Odm,
pu4Byte AFEReg,
pu4Byte AFEBackup,
@ -11006,13 +10995,13 @@ ODM_SingleDualAntennaDetection(
bool bResult = true;
u4Byte AFE_Backup[16];
u4Byte AFE_REG_8723A[16] = {
rRx_Wait_CCA, rTx_CCK_RFON,
rTx_CCK_BBON, rTx_OFDM_RFON,
rTx_OFDM_BBON, rTx_To_Rx,
rTx_To_Tx, rRx_CCK,
rRx_OFDM, rRx_Wait_RIFS,
rRx_TO_Rx, rStandby,
rSleep, rPMPD_ANAEN,
rRx_Wait_CCA, rTx_CCK_RFON,
rTx_CCK_BBON, rTx_OFDM_RFON,
rTx_OFDM_BBON, rTx_To_Rx,
rTx_To_Tx, rRx_CCK,
rRx_OFDM, rRx_Wait_RIFS,
rRx_TO_Rx, rStandby,
rSleep, rPMPD_ANAEN,
rFPGA0_XCD_SwitchControl, rBlue_Tooth};
if (!(pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8192C)))

View file

@ -40,24 +40,14 @@
#define READ_AND_CONFIG_MP(ic, txt) (ODM_ReadAndConfig##txt##ic(pDM_Odm))
#define READ_AND_CONFIG_TC(ic, txt) (ODM_ReadAndConfig_TC##txt##ic(pDM_Odm))
u1Byte
odm_QueryRxPwrPercentage(
s1Byte AntPower
)
static u1Byte odm_QueryRxPwrPercentage(s1Byte AntPower)
{
if ((AntPower <= -100) || (AntPower >= 20))
{
return 0;
}
else if (AntPower >= 0)
{
return 100;
}
else
{
return (100+AntPower);
}
}
#if (DM_ODM_SUPPORT_TYPE != ODM_MP)
@ -65,8 +55,7 @@ odm_QueryRxPwrPercentage(
// 2012/01/12 MH MOve some signal strength smooth method to MP HAL layer.
// IF other SW team do not support the feature, remove this section.??
//
s4Byte
odm_SignalScaleMapping_92CSeries_patch_RT_CID_819x_Lenovo(
static s4Byte odm_SignalScaleMapping_92CSeries_patch_RT_CID_819x_Lenovo(
PDM_ODM_T pDM_Odm,
s4Byte CurrSig
)
@ -81,48 +70,29 @@ odm_SignalScaleMapping_92CSeries_patch_RT_CID_819x_Lenovo(
// This modification makes the RSSI indication similar to Intel solution.
// 20100414 Joseph: Tunning RSSI for Lenovo according to RTL8191SE.
if (CurrSig >= 54 && CurrSig <= 100)
{
RetSig = 100;
}
else if (CurrSig>=42 && CurrSig <= 53)
{
RetSig = 95;
}
else if (CurrSig>=36 && CurrSig <= 41)
{
RetSig = 74 + ((CurrSig - 36) *20)/6;
}
else if (CurrSig>=33 && CurrSig <= 35)
{
RetSig = 65 + ((CurrSig - 33) *8)/2;
}
else if (CurrSig>=18 && CurrSig <= 32)
{
RetSig = 62 + ((CurrSig - 18) *2)/15;
}
else if (CurrSig>=15 && CurrSig <= 17)
{
RetSig = 33 + ((CurrSig - 15) *28)/2;
}
else if (CurrSig>=10 && CurrSig <= 14)
{
RetSig = 39;
}
else if (CurrSig>=8 && CurrSig <= 9)
{
RetSig = 33;
}
else if (CurrSig <= 8)
{
RetSig = 19;
}
}
#endif //ENDIF (DM_ODM_SUPPORT_TYPE == ODM_MP)
return RetSig;
}
s4Byte
odm_SignalScaleMapping_92CSeries_patch_RT_CID_819x_Netcore(
static s4Byte odm_SignalScaleMapping_92CSeries_patch_RT_CID_819x_Netcore(
PDM_ODM_T pDM_Odm,
s4Byte CurrSig
)
@ -182,7 +152,7 @@ odm_SignalScaleMapping_92CSeries_patch_RT_CID_819x_Netcore(
}
s4Byte
static s4Byte
odm_SignalScaleMapping_92CSeries(
PDM_ODM_T pDM_Odm,
s4Byte CurrSig
@ -275,7 +245,7 @@ odm_SignalScaleMapping_92CSeries(
#endif
return RetSig;
}
s4Byte
static s4Byte
odm_SignalScaleMapping(
PDM_ODM_T pDM_Odm,
s4Byte CurrSig
@ -377,7 +347,7 @@ odm_EVMdbToPercentage(
void
static void
odm_RxPhyStatus92CSeries_Parsing(
PDM_ODM_T pDM_Odm,
PODM_PHY_INFO_T pPhyInfo,
@ -746,7 +716,7 @@ odm_Init_RSSIForDM(
}
void
static void
odm_Process_RSSIForDM(
PDM_ODM_T pDM_Odm,
PODM_PHY_INFO_T pPhyInfo,
@ -968,7 +938,7 @@ odm_Process_RSSIForDM(
//
// Endianness before calling this API
//
void
static void
ODM_PhyStatusQuery_92CSeries(
PDM_ODM_T pDM_Odm,
PODM_PHY_INFO_T pPhyInfo,
@ -998,7 +968,7 @@ ODM_PhyStatusQuery_92CSeries(
//
// Endianness before calling this API
//
void
static void
ODM_PhyStatusQuery_JaguarSeries(
PDM_ODM_T pDM_Odm,
PODM_PHY_INFO_T pPhyInfo,

View file

@ -229,7 +229,7 @@ ODM_SetRFReg(
PHY_SetRFReg(pDM_Odm->priv, eRFPath, RegAddr, BitMask, Data);
#elif (DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
PADAPTER Adapter = pDM_Odm->Adapter;
PHY_SetRFReg(Adapter, eRFPath, RegAddr, BitMask, Data);
PHY_SetRFReg(Adapter, (enum _RF_RADIO_PATH)eRFPath, RegAddr, BitMask, Data);
#endif
}
@ -246,7 +246,7 @@ ODM_GetRFReg(
return PHY_QueryRFReg(pDM_Odm->priv, eRFPath, RegAddr, BitMask, 1);
#elif (DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
PADAPTER Adapter = pDM_Odm->Adapter;
return PHY_QueryRFReg(Adapter, eRFPath, RegAddr, BitMask);
return PHY_QueryRFReg(Adapter, (enum _RF_RADIO_PATH)eRFPath, RegAddr, BitMask);
#endif
}

View file

@ -179,38 +179,6 @@ _func_exit_;
return ret;
}
u8 rtl8192c_h2c_msg_hdl(_adapter *padapter, unsigned char *pbuf)
{
u8 ElementID, CmdLen;
u8 *pCmdBuffer;
struct cmd_msg_parm *pcmdmsg;
if (!pbuf)
return H2C_PARAMETERS_ERROR;
pcmdmsg = (struct cmd_msg_parm*)pbuf;
ElementID = pcmdmsg->eid;
CmdLen = pcmdmsg->sz;
pCmdBuffer = pcmdmsg->buf;
FillH2CCmd_88E(padapter, ElementID, CmdLen, pCmdBuffer);
return H2C_SUCCESS;
}
/*
#if defined(CONFIG_AUTOSUSPEND) && defined(SUPPORT_HW_RFOFF_DETECTED)
u8 rtl8192c_set_FwSelectSuspend_cmd(_adapter *padapter ,u8 bfwpoll, u16 period)
{
u8 res=_SUCCESS;
struct H2C_SS_RFOFF_PARAM param;
DBG_88E("==>%s bfwpoll(%x)\n",__func__,bfwpoll);
param.gpio_period = period;//Polling GPIO_11 period time
param.ROFOn = (true == bfwpoll)?1:0;
FillH2CCmd_88E(padapter, SELECTIVE_SUSPEND_ROF_CMD, sizeof(param), (u8*)(&param));
return res;
}
#endif //CONFIG_AUTOSUSPEND && SUPPORT_HW_RFOFF_DETECTED
*/
u8 rtl8188e_set_rssi_cmd(_adapter*padapter, u8 *param)
{
u8 res=_SUCCESS;
@ -234,11 +202,14 @@ u8 rtl8188e_set_raid_cmd(_adapter*padapter, u32 mask)
u8 buf[3];
u8 res=_SUCCESS;
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
_func_enter_;
if (pHalData->fw_ractrl == true){
__le32 lmask;
_rtw_memset(buf, 0, 3);
mask = cpu_to_le32( mask );
_rtw_memcpy(buf, &mask, 3);
lmask = cpu_to_le32( mask );
_rtw_memcpy(buf, &lmask, 3);
FillH2CCmd_88E(padapter, H2C_DM_MACID_CFG, 3, buf);
}else{
@ -380,7 +351,7 @@ void rtl8188e_set_FwMediaStatus_cmd(PADAPTER padapter, u16 mstatus_rpt )
FillH2CCmd_88E(padapter, H2C_COM_MEDIA_STATUS_RPT, sizeof(mst_rpt), (u8 *)&mst_rpt);
}
void ConstructBeacon(_adapter *padapter, u8 *pframe, u32 *pLength)
static void ConstructBeacon(_adapter *padapter, u8 *pframe, u32 *pLength)
{
struct rtw_ieee80211_hdr *pwlanhdr;
u16 *fctrl;
@ -482,7 +453,7 @@ _ConstructBeacon:
}
void ConstructPSPoll(_adapter *padapter, u8 *pframe, u32 *pLength)
static void ConstructPSPoll(_adapter *padapter, u8 *pframe, u32 *pLength)
{
struct rtw_ieee80211_hdr *pwlanhdr;
u16 *fctrl;
@ -512,7 +483,7 @@ void ConstructPSPoll(_adapter *padapter, u8 *pframe, u32 *pLength)
*pLength = 16;
}
void ConstructNullFunctionData(
static void ConstructNullFunctionData(
PADAPTER padapter,
u8 *pframe,
u32 *pLength,
@ -585,7 +556,7 @@ void ConstructNullFunctionData(
*pLength = pktlen;
}
void ConstructProbeRsp(_adapter *padapter, u8 *pframe, u32 *pLength, u8 *StaAddr, bool bHideSSID)
static void ConstructProbeRsp(_adapter *padapter, u8 *pframe, u32 *pLength, u8 *StaAddr, bool bHideSSID)
{
struct rtw_ieee80211_hdr *pwlanhdr;
u16 *fctrl;

View file

@ -217,7 +217,7 @@ exit:
rtw_mfree2d((void *)eFuseWord, EFUSE_MAX_SECTION_88E, EFUSE_MAX_WORD_UNIT, sizeof(u16));
}
void efuse_read_phymap_from_txpktbuf(
static void efuse_read_phymap_from_txpktbuf(
ADAPTER *adapter,
int bcnhead, //beacon head, where FW store len(2-byte) and efuse physical map.
u8 *content, //buffer to store efuse physical map
@ -352,7 +352,7 @@ static s32 iol_ioconfig(
return rst;
}
int rtl8188e_IOL_exec_cmds_sync(ADAPTER *adapter, struct xmit_frame *xmit_frame, u32 max_wating_ms,u32 bndy_cnt)
static int rtl8188e_IOL_exec_cmds_sync(ADAPTER *adapter, struct xmit_frame *xmit_frame, u32 max_wating_ms,u32 bndy_cnt)
{
u32 start_time = rtw_get_current_time();
@ -1358,7 +1358,7 @@ rtl8188e_ReadEFuse(
}
//Do not support BT
void
static void
Hal_EFUSEGetEfuseDefinition88E(
PADAPTER pAdapter,
u1Byte efuseType,
@ -1426,8 +1426,8 @@ Hal_EFUSEGetEfuseDefinition88E(
break;
}
}
void
Hal_EFUSEGetEfuseDefinition_Pseudo88E(
static void Hal_EFUSEGetEfuseDefinition_Pseudo88E(
PADAPTER pAdapter,
u8 efuseType,
u8 type,
@ -2515,7 +2515,7 @@ static void rtl8188e_read_chip_version(PADAPTER padapter)
ReadChipVersion8188E(padapter);
}
void rtl8188e_GetHalODMVar(
static void rtl8188e_GetHalODMVar(
PADAPTER Adapter,
HAL_ODM_VARIABLE eVariable,
void * pValue1,
@ -2530,7 +2530,7 @@ void rtl8188e_GetHalODMVar(
break;
}
}
void rtl8188e_SetHalODMVar(
static void rtl8188e_SetHalODMVar(
PADAPTER Adapter,
HAL_ODM_VARIABLE eVariable,
void * pValue1,
@ -2639,7 +2639,8 @@ void rtl8188e_stop_thread(_adapter *padapter)
#endif
#endif
}
void hal_notch_filter_8188e(_adapter *adapter, bool enable)
static void hal_notch_filter_8188e(_adapter *adapter, bool enable)
{
if (enable) {
DBG_88E("Enable notch filter\n");
@ -2734,7 +2735,7 @@ u8 GetEEPROMSize8188E(PADAPTER padapter)
// LLT R/W/Init function
//
//-------------------------------------------------------------------------
s32 _LLTWrite(PADAPTER padapter, u32 address, u32 data)
static s32 _LLTWrite(PADAPTER padapter, u32 address, u32 data)
{
s32 status = _SUCCESS;
s32 count = 0;
@ -2761,31 +2762,6 @@ s32 _LLTWrite(PADAPTER padapter, u32 address, u32 data)
return status;
}
u8 _LLTRead(PADAPTER padapter, u32 address)
{
s32 count = 0;
u32 value = _LLT_INIT_ADDR(address) | _LLT_OP(_LLT_READ_ACCESS);
u16 LLTReg = REG_LLT_INIT;
rtw_write32(padapter, LLTReg, value);
//polling and get value
do {
value = rtw_read32(padapter, LLTReg);
if (_LLT_NO_ACTIVE == _LLT_OP_VALUE(value)) {
return (u8)value;
}
if (count > POLLING_LLT_THRESHOLD) {
RT_TRACE(_module_hal_init_c_, _drv_err_, ("Failed to polling read LLT done at address %d!\n", address));
break;
}
} while (count++);
return 0xFF;
}
s32 InitLLTTable(PADAPTER padapter, u8 txpktbuf_bndy)
{
s32 status = _FAIL;

View file

@ -488,19 +488,6 @@ void Hal_SetTxPower(PADAPTER pAdapter)
// SetOFDMTxPower(pAdapter, TxPower);
}
void Hal_SetTxAGCOffset(PADAPTER pAdapter, u32 ulTxAGCOffset)
{
u32 TxAGCOffset_B, TxAGCOffset_C, TxAGCOffset_D,tmpAGC;
TxAGCOffset_B = (ulTxAGCOffset&0x000000ff);
TxAGCOffset_C = ((ulTxAGCOffset&0x0000ff00)>>8);
TxAGCOffset_D = ((ulTxAGCOffset&0x00ff0000)>>16);
tmpAGC = (TxAGCOffset_D<<8 | TxAGCOffset_C<<4 | TxAGCOffset_B);
write_bbreg(pAdapter, rFPGA0_TxGainStage,
(bXBTxAGC|bXCTxAGC|bXDTxAGC), tmpAGC);
}
void Hal_SetDataRate(PADAPTER pAdapter)
{
Hal_mpt_SwitchRfSetting(pAdapter);

View file

@ -1074,12 +1074,8 @@ phy_ConfigBBWithParaFile(
//****************************************
// The following is for High Power PA
//****************************************
void
phy_ConfigBBExternalPA(
PADAPTER Adapter
)
static void phy_ConfigBBExternalPA(PADAPTER Adapter)
{
#ifdef CONFIG_USB_HCI
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
u16 i=0;
u32 temp=0;
@ -1089,7 +1085,6 @@ phy_ConfigBBExternalPA(
// 2010/10/19 MH According to Jenyu/EEChou 's opinion, we need not to execute the
// same code as SU. It is already updated in PHY_REG_1T_HP.txt.
#endif
}
/*-----------------------------------------------------------------------------
@ -1677,30 +1672,7 @@ rtl8188e_PHY_ConfigRFWithParaFile(
}
//****************************************
// The following is for High Power PA
//****************************************
#define HighPowerRadioAArrayLen 22
//This is for High power PA
u32 Rtl8192S_HighPower_RadioA_Array[HighPowerRadioAArrayLen] = {
0x013,0x00029ea4,
0x013,0x00025e74,
0x013,0x00020ea4,
0x013,0x0001ced0,
0x013,0x00019f40,
0x013,0x00014e70,
0x013,0x000106a0,
0x013,0x0000c670,
0x013,0x000082a0,
0x013,0x00004270,
0x013,0x00000240,
};
int
PHY_ConfigRFExternalPA(
PADAPTER Adapter,
RF_RADIO_PATH_E eRFPath
)
static int PHY_ConfigRFExternalPA(PADAPTER Adapter, RF_RADIO_PATH_E eRFPath)
{
int rtStatus = _SUCCESS;
#ifdef CONFIG_USB_HCI
@ -1901,97 +1873,6 @@ exit:
}
#endif//#ifndef CONFIG_PHY_SETTING_WITH_ODM
/*-----------------------------------------------------------------------------
* Function: PHY_CheckBBAndRFOK()
*
* Overview: This function is write register and then readback to make sure whether
* BB[PHY0, PHY1], RF[Patha, path b, path c, path d] is Ok
*
* Input: PADAPTER Adapter
* HW90_BLOCK_E CheckBlock
* RF_RADIO_PATH_E eRFPath // it is used only when CheckBlock is HW90_BLOCK_RF
*
* Output: NONE
*
* Return: RT_STATUS_SUCCESS: PHY is OK
*
* Note: This function may be removed in the ASIC
*---------------------------------------------------------------------------*/
int
PHY_CheckBBAndRFOK(
PADAPTER Adapter,
HW90_BLOCK_E CheckBlock,
RF_RADIO_PATH_E eRFPath
)
{
int rtStatus = _SUCCESS;
u32 i, CheckTimes = 4,ulRegRead = 0;
u32 WriteAddr[4];
u32 WriteData[] = {0xfffff027, 0xaa55a02f, 0x00000027, 0x55aa502f};
// Initialize register address offset to be checked
WriteAddr[HW90_BLOCK_MAC] = 0x100;
WriteAddr[HW90_BLOCK_PHY0] = 0x900;
WriteAddr[HW90_BLOCK_PHY1] = 0x800;
WriteAddr[HW90_BLOCK_RF] = 0x3;
for (i=0 ; i < CheckTimes ; i++)
{
//
// Write Data to register and readback
//
switch (CheckBlock)
{
case HW90_BLOCK_MAC:
//RT_ASSERT(false, ("PHY_CheckBBRFOK(): Never Write 0x100 here!"));
//RT_TRACE(COMP_INIT, DBG_LOUD, ("PHY_CheckBBRFOK(): Never Write 0x100 here!\n"));
break;
case HW90_BLOCK_PHY0:
case HW90_BLOCK_PHY1:
rtw_write32(Adapter, WriteAddr[CheckBlock], WriteData[i]);
ulRegRead = rtw_read32(Adapter, WriteAddr[CheckBlock]);
break;
case HW90_BLOCK_RF:
// When initialization, we want the delay function(delay_ms(), delay_us()
// ==> actually we call PlatformStallExecution()) to do NdisStallExecution()
// [busy wait] instead of NdisMSleep(). So we acquire RT_INITIAL_SPINLOCK
// to run at Dispatch level to achive it.
//cosa PlatformAcquireSpinLock(Adapter, RT_INITIAL_SPINLOCK);
WriteData[i] &= 0xfff;
PHY_SetRFReg(Adapter, eRFPath, WriteAddr[HW90_BLOCK_RF], bRFRegOffsetMask, WriteData[i]);
// TODO: we should not delay for such a long time. Ask SD3
rtw_mdelay_os(10);
ulRegRead = PHY_QueryRFReg(Adapter, eRFPath, WriteAddr[HW90_BLOCK_RF], bMaskDWord);
rtw_mdelay_os(10);
//cosa PlatformReleaseSpinLock(Adapter, RT_INITIAL_SPINLOCK);
break;
default:
rtStatus = _FAIL;
break;
}
//
// Check whether readback data is correct
//
if (ulRegRead != WriteData[i])
{
//RT_TRACE(COMP_FPGA, DBG_LOUD, ("ulRegRead: %lx, WriteData: %lx\n", ulRegRead, WriteData[i]));
rtStatus = _FAIL;
break;
}
}
return rtStatus;
}
void
rtl8192c_PHY_GetHWRegOriginalValue(
PADAPTER Adapter
@ -2004,19 +1885,12 @@ rtl8192c_PHY_GetHWRegOriginalValue(
pHalData->DefaultInitialGain[1] = (u8)PHY_QueryBBReg(Adapter, rOFDM0_XBAGCCore1, bMaskByte0);
pHalData->DefaultInitialGain[2] = (u8)PHY_QueryBBReg(Adapter, rOFDM0_XCAGCCore1, bMaskByte0);
pHalData->DefaultInitialGain[3] = (u8)PHY_QueryBBReg(Adapter, rOFDM0_XDAGCCore1, bMaskByte0);
//RT_TRACE(COMP_INIT, DBG_LOUD,
//("Default initial gain (c50=0x%x, c58=0x%x, c60=0x%x, c68=0x%x)\n",
//pHalData->DefaultInitialGain[0], pHalData->DefaultInitialGain[1],
//pHalData->DefaultInitialGain[2], pHalData->DefaultInitialGain[3]));
// read framesync
pHalData->framesync = (u8)PHY_QueryBBReg(Adapter, rOFDM0_RxDetector3, bMaskByte0);
pHalData->framesyncC34 = PHY_QueryBBReg(Adapter, rOFDM0_RxDetector2, bMaskDWord);
//RT_TRACE(COMP_INIT, DBG_LOUD, ("Default framesync (0x%x) = 0x%x\n",
// rOFDM0_RxDetector3, pHalData->framesync));
}
//
// Description:
// Map dBm into Tx power index according to
@ -2080,12 +1954,7 @@ phy_DbmToTxPwrIdx(
// current wireless mode.
// By Bruce, 2008-01-29.
//
int
phy_TxPwrIdxToDbm(
PADAPTER Adapter,
WIRELESS_MODE WirelessMode,
u8 TxPwrIdx
)
static int phy_TxPwrIdxToDbm(PADAPTER Adapter, WIRELESS_MODE WirelessMode, u8 TxPwrIdx)
{
int Offset = 0;
int PwrOutDbm = 0;
@ -2165,30 +2034,21 @@ PHY_GetTxPowerLevel8188E(
*powerlevel = TxPwrDbm;
}
void getTxPowerIndex88E(
PADAPTER Adapter,
u8 channel,
u8* cckPowerLevel,
u8* ofdmPowerLevel,
u8* BW20PowerLevel,
u8* BW40PowerLevel
)
static void getTxPowerIndex88E(PADAPTER Adapter, u8 channel, u8 *cckPowerLevel,
u8 *ofdmPowerLevel, u8 *BW20PowerLevel,
u8 *BW40PowerLevel)
{
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
u8 index = (channel -1);
u8 TxCount=0,path_nums;
if ((RF_1T2R == pHalData->rf_type) ||(RF_1T1R ==pHalData->rf_type ))
if ((RF_1T2R == pHalData->rf_type) || (RF_1T1R ==pHalData->rf_type))
path_nums = 1;
else
path_nums = 2;
for (TxCount=0;TxCount< path_nums ;TxCount++)
{
if (TxCount==RF_PATH_A)
{
for (TxCount=0; TxCount < path_nums; TxCount++) {
if (TxCount==RF_PATH_A) {
// 1. CCK
cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index];
//2. OFDM
@ -2212,10 +2072,8 @@ void getTxPowerIndex88E(
pHalData->BW20_24G_Diff[TxCount][index];
//2. BW40
BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index];
}
else if (TxCount==RF_PATH_C)
{
// 1. CCK
} else if (TxCount==RF_PATH_C) {
// 1. CCK
cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index];
//2. OFDM
ofdmPowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index]+
@ -2229,9 +2087,7 @@ void getTxPowerIndex88E(
pHalData->BW20_24G_Diff[TxCount][index];
//2. BW40
BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index];
}
else if (TxCount==RF_PATH_D)
{
} else if (TxCount==RF_PATH_D) {
// 1. CCK
cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index];
//2. OFDM
@ -2251,22 +2107,12 @@ void getTxPowerIndex88E(
//2. BW40
BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index];
}
else
{
}
}
}
void phy_PowerIndexCheck88E(
PADAPTER Adapter,
u8 channel,
u8 * cckPowerLevel,
u8 * ofdmPowerLevel,
u8 * BW20PowerLevel,
u8 * BW40PowerLevel
)
static void phy_PowerIndexCheck88E(PADAPTER Adapter, u8 channel, u8 *cckPowerLevel,
u8 *ofdmPowerLevel, u8 *BW20PowerLevel, u8 *BW40PowerLevel)
{
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
pHalData->CurrentCckTxPwrIdx = cckPowerLevel[0];
@ -2370,26 +2216,6 @@ PHY_UpdateTxPowerDbm8188E(
return true;
}
/*
Description:
When beacon interval is changed, the values of the
hw registers should be modified.
By tynli, 2008.10.24.
*/
void
rtl8192c_PHY_SetBeaconHwReg(
PADAPTER Adapter,
u16 BeaconInterval
)
{
}
void
PHY_ScanOperationBackup8188E(
PADAPTER Adapter,
@ -2835,78 +2661,48 @@ PHY_SetMonitorMode8192C(
* 11/15/2007 MHC Create Version 0.
*
*---------------------------------------------------------------------------*/
bool
PHY_CheckIsLegalRfPath8192C(
PADAPTER pAdapter,
u32 eRFPath)
bool PHY_CheckIsLegalRfPath8192C(PADAPTER pAdapter, u32 eRFPath)
{
// HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
bool rtValue = true;
// NOt check RF Path now.!
return rtValue;
return true;
} /* PHY_CheckIsLegalRfPath8192C */
static void _PHY_SetRFPathSwitch(
PADAPTER pAdapter,
bool bMain,
bool is2T
)
static void _PHY_SetRFPathSwitch(PADAPTER pAdapter, bool bMain, bool is2T)
{
u8 u1bTmp;
if (!pAdapter->hw_init_completed)
{
if (!pAdapter->hw_init_completed) {
u1bTmp = rtw_read8(pAdapter, REG_LEDCFG2) | BIT7;
rtw_write8(pAdapter, REG_LEDCFG2, u1bTmp);
//PHY_SetBBReg(pAdapter, REG_LEDCFG0, BIT23, 0x01);
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFParameter, BIT13, 0x01);
}
if (is2T)
{
if (is2T) {
if (bMain)
PHY_SetBBReg(pAdapter, rFPGA0_XB_RFInterfaceOE, BIT5|BIT6, 0x1); //92C_Path_A
else
PHY_SetBBReg(pAdapter, rFPGA0_XB_RFInterfaceOE, BIT5|BIT6, 0x2); //BT
}
else
{
} else {
if (bMain)
PHY_SetBBReg(pAdapter, rFPGA0_XA_RFInterfaceOE, 0x300, 0x2); //Main
else
PHY_SetBBReg(pAdapter, rFPGA0_XA_RFInterfaceOE, 0x300, 0x1); //Aux
}
}
//return value true => Main; false => Aux
static bool _PHY_QueryRFPathSwitch(
PADAPTER pAdapter,
bool is2T
)
static bool _PHY_QueryRFPathSwitch(PADAPTER pAdapter, bool is2T)
{
// if (is2T)
// return true;
if (!pAdapter->hw_init_completed)
{
if (!pAdapter->hw_init_completed) {
PHY_SetBBReg(pAdapter, REG_LEDCFG0, BIT23, 0x01);
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFParameter, BIT13, 0x01);
}
if (is2T)
{
if (is2T) {
if (PHY_QueryBBReg(pAdapter, rFPGA0_XB_RFInterfaceOE, BIT5|BIT6) == 0x01)
return true;
else
return false;
}
else
{
} else {
if (PHY_QueryBBReg(pAdapter, rFPGA0_XA_RFInterfaceOE, 0x300) == 0x02)
return true;
else
@ -2914,67 +2710,10 @@ static bool _PHY_QueryRFPathSwitch(
}
}
static void
_PHY_DumpRFReg( PADAPTER pAdapter)
static void _PHY_DumpRFReg(PADAPTER pAdapter)
{
u32 rfRegValue,rfRegOffset;
//RTPRINT(FINIT, INIT_RF, ("PHY_DumpRFReg()====>\n"));
for (rfRegOffset = 0x00;rfRegOffset<=0x30;rfRegOffset++){
for (rfRegOffset = 0x00;rfRegOffset<=0x30;rfRegOffset++)
rfRegValue = PHY_QueryRFReg(pAdapter,RF_PATH_A, rfRegOffset, bMaskDWord);
//RTPRINT(FINIT, INIT_RF, (" 0x%02x = 0x%08x\n",rfRegOffset,rfRegValue));
}
//RTPRINT(FINIT, INIT_RF, ("<===== PHY_DumpRFReg()\n"));
}
//
// Move from phycfg.c to gen.c to be code independent later
//
//-------------------------Move to other DIR later----------------------------*/
#ifdef CONFIG_USB_HCI
//
// Description:
// To dump all Tx FIFO LLT related link-list table.
// Added by Roger, 2009.03.10.
//
void
DumpBBDbgPort_92CU(
PADAPTER Adapter
)
{
//RT_TRACE(COMP_SEND, DBG_WARNING, ("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"));
//RT_TRACE(COMP_SEND, DBG_WARNING, ("BaseBand Debug Ports:\n"));
PHY_SetBBReg(Adapter, 0x0908, 0xffff, 0x0000);
//RT_TRACE(COMP_SEND, DBG_WARNING, ("Offset[%x]: %x\n", 0xdf4, PHY_QueryBBReg(Adapter, 0x0df4, bMaskDWord)));
PHY_SetBBReg(Adapter, 0x0908, 0xffff, 0x0803);
//RT_TRACE(COMP_SEND, DBG_WARNING, ("Offset[%x]: %x\n", 0xdf4, PHY_QueryBBReg(Adapter, 0x0df4, bMaskDWord)));
PHY_SetBBReg(Adapter, 0x0908, 0xffff, 0x0a06);
//RT_TRACE(COMP_SEND, DBG_WARNING, ("Offset[%x]: %x\n", 0xdf4, PHY_QueryBBReg(Adapter, 0x0df4, bMaskDWord)));
PHY_SetBBReg(Adapter, 0x0908, 0xffff, 0x0007);
//RT_TRACE(COMP_SEND, DBG_WARNING, ("Offset[%x]: %x\n", 0xdf4, PHY_QueryBBReg(Adapter, 0x0df4, bMaskDWord)));
PHY_SetBBReg(Adapter, 0x0908, 0xffff, 0x0100);
PHY_SetBBReg(Adapter, 0x0a28, 0x00ff0000, 0x000f0000);
//RT_TRACE(COMP_SEND, DBG_WARNING, ("Offset[%x]: %x\n", 0xdf4, PHY_QueryBBReg(Adapter, 0x0df4, bMaskDWord)));
PHY_SetBBReg(Adapter, 0x0908, 0xffff, 0x0100);
PHY_SetBBReg(Adapter, 0x0a28, 0x00ff0000, 0x00150000);
//RT_TRACE(COMP_SEND, DBG_WARNING, ("Offset[%x]: %x\n", 0xdf4, PHY_QueryBBReg(Adapter, 0x0df4, bMaskDWord)));
//RT_TRACE(COMP_SEND, DBG_WARNING, ("Offset[%x]: %x\n", 0x800, PHY_QueryBBReg(Adapter, 0x0800, bMaskDWord)));
//RT_TRACE(COMP_SEND, DBG_WARNING, ("Offset[%x]: %x\n", 0x900, PHY_QueryBBReg(Adapter, 0x0900, bMaskDWord)));
//RT_TRACE(COMP_SEND, DBG_WARNING, ("Offset[%x]: %x\n", 0xa00, PHY_QueryBBReg(Adapter, 0x0a00, bMaskDWord)));
//RT_TRACE(COMP_SEND, DBG_WARNING, ("Offset[%x]: %x\n", 0xa54, PHY_QueryBBReg(Adapter, 0x0a54, bMaskDWord)));
//RT_TRACE(COMP_SEND, DBG_WARNING, ("Offset[%x]: %x\n", 0xa58, PHY_QueryBBReg(Adapter, 0x0a58, bMaskDWord)));
}
#endif

View file

@ -282,7 +282,7 @@ rtl8188e_PHY_RF6052SetCckTxPower(
// powerbase0 for OFDM rates
// powerbase1 for HT MCS rates
//
void getPowerBase88E(
static void getPowerBase88E(
PADAPTER Adapter,
u8* pPowerLevelOFDM,
u8* pPowerLevelBW20,
@ -325,7 +325,7 @@ void getPowerBase88E(
}
}
void getTxPowerWriteValByRegulatory88E(
static void getTxPowerWriteValByRegulatory88E(
PADAPTER Adapter,
u8 Channel,
u8 index,
@ -779,232 +779,4 @@ PHY_RF6052_Config8188E(
return rtStatus;
}
//
// ==> RF shadow Operation API Code Section!!!
//
/*-----------------------------------------------------------------------------
* Function: PHY_RFShadowRead
* PHY_RFShadowWrite
* PHY_RFShadowCompare
* PHY_RFShadowRecorver
* PHY_RFShadowCompareAll
* PHY_RFShadowRecorverAll
* PHY_RFShadowCompareFlagSet
* PHY_RFShadowRecorverFlagSet
*
* Overview: When we set RF register, we must write shadow at first.
* When we are running, we must compare shadow abd locate error addr.
* Decide to recorver or not.
*
* Input: NONE
*
* Output: NONE
*
* Return: NONE
*
* Revised History:
* When Who Remark
* 11/20/2008 MHC Create Version 0.
*
*---------------------------------------------------------------------------*/
u32
PHY_RFShadowRead(
PADAPTER Adapter,
RF_RADIO_PATH_E eRFPath,
u32 Offset)
{
return RF_Shadow[eRFPath][Offset].Value;
} /* PHY_RFShadowRead */
void
PHY_RFShadowWrite(
PADAPTER Adapter,
RF_RADIO_PATH_E eRFPath,
u32 Offset,
u32 Data)
{
RF_Shadow[eRFPath][Offset].Value = (Data & bRFRegOffsetMask);
RF_Shadow[eRFPath][Offset].Driver_Write = true;
} /* PHY_RFShadowWrite */
bool
PHY_RFShadowCompare(
PADAPTER Adapter,
RF_RADIO_PATH_E eRFPath,
u32 Offset)
{
u32 reg;
// Check if we need to check the register
if (RF_Shadow[eRFPath][Offset].Compare == true)
{
reg = PHY_QueryRFReg(Adapter, eRFPath, Offset, bRFRegOffsetMask);
// Compare shadow and real rf register for 20bits!!
if (RF_Shadow[eRFPath][Offset].Value != reg)
{
// Locate error position.
RF_Shadow[eRFPath][Offset].ErrorOrNot = true;
//RT_TRACE(COMP_INIT, DBG_LOUD,
//("PHY_RFShadowCompare RF-%d Addr%02lx Err = %05lx\n",
//eRFPath, Offset, reg));
}
return RF_Shadow[eRFPath][Offset].ErrorOrNot ;
}
return false;
} /* PHY_RFShadowCompare */
void
PHY_RFShadowRecorver(
PADAPTER Adapter,
RF_RADIO_PATH_E eRFPath,
u32 Offset)
{
// Check if the address is error
if (RF_Shadow[eRFPath][Offset].ErrorOrNot == true)
{
// Check if we need to recorver the register.
if (RF_Shadow[eRFPath][Offset].Recorver == true)
{
PHY_SetRFReg(Adapter, eRFPath, Offset, bRFRegOffsetMask,
RF_Shadow[eRFPath][Offset].Value);
//RT_TRACE(COMP_INIT, DBG_LOUD,
//("PHY_RFShadowRecorver RF-%d Addr%02lx=%05lx",
//eRFPath, Offset, RF_Shadow[eRFPath][Offset].Value));
}
}
} /* PHY_RFShadowRecorver */
void
PHY_RFShadowCompareAll(
PADAPTER Adapter)
{
u32 eRFPath;
u32 Offset;
for (eRFPath = 0; eRFPath < RF6052_MAX_PATH; eRFPath++)
{
for (Offset = 0; Offset <= RF6052_MAX_REG; Offset++)
{
PHY_RFShadowCompare(Adapter, (RF_RADIO_PATH_E)eRFPath, Offset);
}
}
} /* PHY_RFShadowCompareAll */
void
PHY_RFShadowRecorverAll(
PADAPTER Adapter)
{
u32 eRFPath;
u32 Offset;
for (eRFPath = 0; eRFPath < RF6052_MAX_PATH; eRFPath++)
{
for (Offset = 0; Offset <= RF6052_MAX_REG; Offset++)
{
PHY_RFShadowRecorver(Adapter, (RF_RADIO_PATH_E)eRFPath, Offset);
}
}
} /* PHY_RFShadowRecorverAll */
void
PHY_RFShadowCompareFlagSet(
PADAPTER Adapter,
RF_RADIO_PATH_E eRFPath,
u32 Offset,
u8 Type)
{
// Set True or False!!!
RF_Shadow[eRFPath][Offset].Compare = Type;
} /* PHY_RFShadowCompareFlagSet */
void
PHY_RFShadowRecorverFlagSet(
PADAPTER Adapter,
RF_RADIO_PATH_E eRFPath,
u32 Offset,
u8 Type)
{
// Set True or False!!!
RF_Shadow[eRFPath][Offset].Recorver= Type;
} /* PHY_RFShadowRecorverFlagSet */
void
PHY_RFShadowCompareFlagSetAll(
PADAPTER Adapter)
{
u32 eRFPath;
u32 Offset;
for (eRFPath = 0; eRFPath < RF6052_MAX_PATH; eRFPath++)
{
for (Offset = 0; Offset <= RF6052_MAX_REG; Offset++)
{
// 2008/11/20 MH For S3S4 test, we only check reg 26/27 now!!!!
if (Offset != 0x26 && Offset != 0x27)
PHY_RFShadowCompareFlagSet(Adapter, (RF_RADIO_PATH_E)eRFPath, Offset, false);
else
PHY_RFShadowCompareFlagSet(Adapter, (RF_RADIO_PATH_E)eRFPath, Offset, true);
}
}
} /* PHY_RFShadowCompareFlagSetAll */
void
PHY_RFShadowRecorverFlagSetAll(
PADAPTER Adapter)
{
u32 eRFPath;
u32 Offset;
for (eRFPath = 0; eRFPath < RF6052_MAX_PATH; eRFPath++)
{
for (Offset = 0; Offset <= RF6052_MAX_REG; Offset++)
{
// 2008/11/20 MH For S3S4 test, we only check reg 26/27 now!!!!
if (Offset != 0x26 && Offset != 0x27)
PHY_RFShadowRecorverFlagSet(Adapter, (RF_RADIO_PATH_E)eRFPath, Offset, false);
else
PHY_RFShadowRecorverFlagSet(Adapter, (RF_RADIO_PATH_E)eRFPath, Offset, true);
}
}
} /* PHY_RFShadowCompareFlagSetAll */
void
PHY_RFShadowRefresh(
PADAPTER Adapter)
{
u32 eRFPath;
u32 Offset;
for (eRFPath = 0; eRFPath < RF6052_MAX_PATH; eRFPath++)
{
for (Offset = 0; Offset <= RF6052_MAX_REG; Offset++)
{
RF_Shadow[eRFPath][Offset].Value = 0;
RF_Shadow[eRFPath][Offset].Compare = false;
RF_Shadow[eRFPath][Offset].Recorver = false;
RF_Shadow[eRFPath][Offset].ErrorOrNot = false;
RF_Shadow[eRFPath][Offset].Driver_Write = false;
}
}
} /* PHY_RFShadowRead */
/* End of HalRf6052.c */

View file

@ -3524,9 +3524,7 @@ _func_enter_;
// Forece leave RF low power mode for 1T1R to prevent conficting setting in Fw power
// saving sequence. 2010.06.07. Added by tynli. Suggested by SD3 yschang.
if ( (psmode != PS_MODE_ACTIVE) && (!IS_92C_SERIAL(pHalData->VersionID)))
{
ODM_RF_Saving(podmpriv, true);
}
rtl8188e_set_FwPwrMode_cmd(Adapter, psmode);
}
break;

View file

@ -377,7 +377,7 @@ static int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata
}
#ifdef CONFIG_SUPPORT_USB_INT
void interrupt_handler_8188eu(_adapter *padapter,u16 pkt_len,u8 *pbuf)
static void interrupt_handler_8188eu(_adapter *padapter,u16 pkt_len,u8 *pbuf)
{
HAL_DATA_TYPE *pHalData=GET_HAL_DATA(padapter);
struct reportpwrstate_parm pwr_rpt;

View file

@ -89,12 +89,12 @@ typedef struct tag_HAL_VERSION
//HAL_VERSION VersionID;
// Get element
#define GET_CVID_IC_TYPE(version) ((HAL_IC_TYPE_E)(((HAL_VERSION)version).ICType) )
#define GET_CVID_CHIP_TYPE(version) ((HAL_CHIP_TYPE_E)(((HAL_VERSION)version).ChipType) )
#define GET_CVID_RF_TYPE(version) ((HAL_RF_TYPE_E)(((HAL_VERSION)version).RFType))
#define GET_CVID_MANUFACTUER(version) ((HAL_VENDOR_E)(((HAL_VERSION)version).VendorType))
#define GET_CVID_CUT_VERSION(version) ((HAL_CUT_VERSION_E)(((HAL_VERSION)version).CUTVersion))
#define GET_CVID_ROM_VERSION(version) ((((HAL_VERSION)version).ROMVer) & ROM_VERSION_MASK)
#define GET_CVID_IC_TYPE(version) (((version).ICType))
#define GET_CVID_CHIP_TYPE(version) (((version).ChipType))
#define GET_CVID_RF_TYPE(version) (((version).RFType))
#define GET_CVID_MANUFACTUER(version) (((version).VendorType))
#define GET_CVID_CUT_VERSION(version) (((version).CUTVersion))
#define GET_CVID_ROM_VERSION(version) (((version).ROMVer) & ROM_VERSION_MASK)
//----------------------------------------------------------------------------
//Common Macro. --
@ -124,9 +124,9 @@ typedef struct tag_HAL_VERSION
#define IS_CHIP_VENDOR_UMC(version) ((GET_CVID_MANUFACTUER(version) == CHIP_VENDOR_UMC)? true: false)
//HAL_RF_TYPE_E
#define IS_1T1R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_1T1R)? true : false )
#define IS_1T2R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_1T2R)? true : false)
#define IS_2T2R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_2T2R)? true : false)
#define IS_1T1R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_1T1R) ? true : false )
#define IS_1T2R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_1T2R) ? true : false)
#define IS_2T2R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_2T2R) ? true : false)
//----------------------------------------------------------------------------

View file

@ -146,4 +146,9 @@ void rtw_drv_if2_free(_adapter *if2);
void rtw_drv_if2_stop(_adapter *if2);
#endif
#ifdef SUPPORT_HW_RFOFF_DETECTED
int rtw_hw_suspend(_adapter *padapter );
int rtw_hw_resume(_adapter *padapter);
#endif
#endif //_OSDEP_INTF_H_

View file

@ -453,10 +453,6 @@ extern void _rtw_mutex_init(_mutex *pmutex);
extern void _rtw_mutex_free(_mutex *pmutex);
extern void _rtw_spinlock_init(_lock *plock);
extern void _rtw_spinlock_free(_lock *plock);
extern void _rtw_spinlock(_lock *plock);
extern void _rtw_spinunlock(_lock *plock);
extern void _rtw_spinlock_ex(_lock *plock);
extern void _rtw_spinunlock_ex(_lock *plock);
extern void _rtw_init_queue(_queue *pqueue);
extern u32 _rtw_queue_empty(_queue *pqueue);

View file

@ -52,6 +52,7 @@ int rtw_os_recvbuf_resource_free(_adapter *padapter, struct recv_buf *precvbuf);
void rtw_os_read_port(_adapter *padapter, struct recv_buf *precvbuf);
void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl);
int nat25_handle_frame(_adapter *priv, struct sk_buff *skb);
#endif //

View file

@ -1086,7 +1086,7 @@ enum rtw_h2c_cmd
#define _SetRFReg_CMD_ _Write_RFREG_CMD_
#ifdef _RTW_CMD_C_
struct _cmd_callback rtw_cmd_callback[] =
static struct _cmd_callback rtw_cmd_callback[] =
{
{GEN_CMD_CODE(_Read_MACREG), NULL}, /*0*/
{GEN_CMD_CODE(_Write_MACREG), NULL},

View file

@ -264,5 +264,8 @@ extern NDIS_STATUS drv_set_info(
u32* BytesRead,
u32* BytesNeeded
);
#ifdef CONFIG_GLOBAL_UI_PID
extern int ui_pid[3];
#endif
#endif // #ifndef __INC_CEINFO_

View file

@ -31,29 +31,6 @@ typedef struct _BSSIDInfo {
NDIS_802_11_PMKID_VALUE PMKID;
} BSSIDInfo, *PBSSIDInfo;
#ifdef PLATFORM_OS_XP
typedef struct _NDIS_802_11_PMKID {
u32 Length;
u32 BSSIDInfoCount;
BSSIDInfo BSSIDInfo[1];
} NDIS_802_11_PMKID, *PNDIS_802_11_PMKID;
#endif
#ifdef PLATFORM_WINDOWS
u8 rtw_set_802_11_reload_defaults(_adapter * padapter, NDIS_802_11_RELOAD_DEFAULTS reloadDefaults);
u8 rtw_set_802_11_test(_adapter * padapter, NDIS_802_11_TEST * test);
u8 rtw_set_802_11_pmkid(_adapter *pdapter, NDIS_802_11_PMKID *pmkid);
u8 rtw_pnp_set_power_sleep(_adapter* padapter);
u8 rtw_pnp_set_power_wakeup(_adapter* padapter);
void rtw_pnp_resume_wk(void *context);
void rtw_pnp_sleep_wk(void * context);
#endif
u8 rtw_set_802_11_add_key(_adapter * padapter, NDIS_802_11_KEY * key);
u8 rtw_set_802_11_authentication_mode(_adapter *pdapter, NDIS_802_11_AUTHENTICATION_MODE authmode);
u8 rtw_set_802_11_bssid(_adapter* padapter, u8 *bssid);
@ -72,5 +49,6 @@ u16 rtw_get_cur_max_rate(_adapter *adapter);
int rtw_set_scan_mode(_adapter *adapter, RT_SCAN_TYPE scan_mode);
int rtw_set_channel_plan(_adapter *adapter, u8 channel_plan);
int rtw_set_country(_adapter *adapter, const char *country_code);
int rtw_change_ifname(_adapter *padapter, const char *ifname);
#endif

View file

@ -821,7 +821,7 @@ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf);
#ifdef _RTW_CMD_C_
struct cmd_hdl wlancmds[] =
static struct cmd_hdl wlancmds[] =
{
GEN_DRV_CMD_HANDLER(0, NULL) /*0*/
GEN_DRV_CMD_HANDLER(0, NULL)

View file

@ -508,14 +508,12 @@ enum RTL871X_MP_IOCTL_SUBCODE {
u32 mp_ioctl_xmit_packet_hdl(struct oid_par_priv* poid_par_priv);
#ifdef _RTW_MP_IOCTL_C_
#define GEN_MP_IOCTL_HANDLER(sz, hdl, oid) {sz, hdl, oid},
#define EXT_MP_IOCTL_HANDLER(sz, subcode, oid) {sz, mp_ioctl_ ## subcode ## _hdl, oid},
struct mp_ioctl_handler mp_ioctl_hdl[] = {
static struct mp_ioctl_handler mp_ioctl_hdl[] = {
/*0*/ GEN_MP_IOCTL_HANDLER(sizeof(u32), oid_rt_pro_start_test_hdl, OID_RT_PRO_START_TEST)
GEN_MP_IOCTL_HANDLER(sizeof(u32), oid_rt_pro_stop_test_hdl, OID_RT_PRO_STOP_TEST)
@ -557,13 +555,6 @@ struct mp_ioctl_handler mp_ioctl_hdl[] = {
/*30*/ GEN_MP_IOCTL_HANDLER(sizeof(u8), oid_rt_set_power_down_hdl, OID_RT_SET_POWER_DOWN)
/*31*/ GEN_MP_IOCTL_HANDLER(0, oid_rt_pro_trigger_gpio_hdl, 0)
};
#else /* _RTW_MP_IOCTL_C_ */
extern struct mp_ioctl_handler mp_ioctl_hdl[];
#endif /* _RTW_MP_IOCTL_C_ */
#endif

View file

@ -25,13 +25,17 @@
#include <drv_types.h>
#include <usb_vendor_req.h>
extern char* rtw_initmac;
extern int rtw_mc2u_disable;
#define USBD_HALTED(Status) ((ULONG)(Status) >> 30 == 3)
//uint usb_dvobj_init(_adapter * adapter);
//void usb_dvobj_deinit(_adapter * adapter);
u8 usbvendorrequest(struct dvobj_priv *pdvobjpriv, RT_USB_BREQUEST brequest, RT_USB_WVALUE wvalue, u8 windex, void* data, u8 datalen, u8 isdirectionin);
int pm_netdev_open(struct net_device *pnetdev,u8 bnormal);
void netdev_br_init(struct net_device *netdev);
void dhcp_flag_bcast(_adapter *priv, struct sk_buff *skb);
void *scdb_findEntry(_adapter *priv, unsigned char *macAddr, unsigned char *ipAddr);
void nat25_db_expire(_adapter *priv);
int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method);
#endif

View file

@ -250,26 +250,26 @@ enum WIFI_REG_DOMAIN {
#define SetToDs(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_TO_DS_); \
*(__le16 *)(pbuf) |= cpu_to_le16(_TO_DS_); \
} while (0)
#define GetToDs(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_TO_DS_)) != 0)
#define ClearToDs(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_TO_DS_)); \
*(__le16 *)(pbuf) &= (~cpu_to_le16(_TO_DS_)); \
} while (0)
#define SetFrDs(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_FROM_DS_); \
*(__le16 *)(pbuf) |= cpu_to_le16(_FROM_DS_); \
} while (0)
#define GetFrDs(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_FROM_DS_)) != 0)
#define ClearFrDs(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_FROM_DS_)); \
*(__le16 *)(pbuf) &= (~cpu_to_le16(_FROM_DS_)); \
} while (0)
#define get_tofr_ds(pframe) ((GetToDs(pframe) << 1) | GetFrDs(pframe))
@ -277,62 +277,62 @@ enum WIFI_REG_DOMAIN {
#define SetMFrag(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_MORE_FRAG_); \
*(__le16 *)(pbuf) |= cpu_to_le16(_MORE_FRAG_); \
} while (0)
#define GetMFrag(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_MORE_FRAG_)) != 0)
#define ClearMFrag(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_MORE_FRAG_)); \
*(__le16 *)(pbuf) &= (~cpu_to_le16(_MORE_FRAG_)); \
} while (0)
#define SetRetry(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_RETRY_); \
*(__le16 *)(pbuf) |= cpu_to_le16(_RETRY_); \
} while (0)
#define GetRetry(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_RETRY_)) != 0)
#define ClearRetry(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_RETRY_)); \
*(__le16 *)(pbuf) &= (~cpu_to_le16(_RETRY_)); \
} while (0)
#define SetPwrMgt(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_PWRMGT_); \
*(__le16 *)(pbuf) |= cpu_to_le16(_PWRMGT_); \
} while (0)
#define GetPwrMgt(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_PWRMGT_)) != 0)
#define ClearPwrMgt(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_PWRMGT_)); \
*(__le16 *)(pbuf) &= (~cpu_to_le16(_PWRMGT_)); \
} while (0)
#define SetMData(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_MORE_DATA_); \
*(__le16 *)(pbuf) |= cpu_to_le16(_MORE_DATA_); \
} while (0)
#define GetMData(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_MORE_DATA_)) != 0)
#define ClearMData(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_MORE_DATA_)); \
*(__le16 *)(pbuf) &= (~cpu_to_le16(_MORE_DATA_)); \
} while (0)
#define SetPrivacy(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_PRIVACY_); \
*(__le16 *)(pbuf) |= cpu_to_le16(_PRIVACY_); \
} while (0)
#define GetPrivacy(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_PRIVACY_)) != 0)
#define ClearPrivacy(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_PRIVACY_)); \
*(__le16 *)(pbuf) &= (~cpu_to_le16(_PRIVACY_)); \
} while (0)
@ -350,8 +350,8 @@ enum WIFI_REG_DOMAIN {
#define SetFrameSubType(pbuf,type) \
do { \
*(unsigned short *)(pbuf) &= cpu_to_le16(~(BIT(7) | BIT(6) | BIT(5) | BIT(4) | BIT(3) | BIT(2))); \
*(unsigned short *)(pbuf) |= cpu_to_le16(type); \
*(__le16 *)(pbuf) &= cpu_to_le16(~(BIT(7) | BIT(6) | BIT(5) | BIT(4) | BIT(3) | BIT(2))); \
*(__le16 *)(pbuf) |= cpu_to_le16(type); \
} while (0)
#define GetSequence(pbuf) (cpu_to_le16(*(unsigned short *)((SIZE_PTR)(pbuf) + 22)) >> 4)
@ -369,32 +369,32 @@ enum WIFI_REG_DOMAIN {
#define SetSeqNum(pbuf, num) \
do { \
*(unsigned short *)((SIZE_PTR)(pbuf) + 22) = \
((*(unsigned short *)((SIZE_PTR)(pbuf) + 22)) & le16_to_cpu((unsigned short)~0xfff0)) | \
*(u16 *)((SIZE_PTR)(pbuf) + 22) = \
((*(u16 *)((SIZE_PTR)(pbuf) + 22)) & le16_to_cpu((unsigned short)0x000f)) | \
le16_to_cpu((unsigned short)(0xfff0 & (num << 4))); \
} while (0)
#define SetDuration(pbuf, dur) \
do { \
*(unsigned short *)((SIZE_PTR)(pbuf) + 2) = cpu_to_le16(0xffff & (dur)); \
*(__le16 *)((SIZE_PTR)(pbuf) + 2) = cpu_to_le16(0xffff & (dur)); \
} while (0)
#define SetPriority(pbuf, tid) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(tid & 0xf); \
*(__le16 *)(pbuf) |= cpu_to_le16(tid & 0xf); \
} while (0)
#define GetPriority(pbuf) ((le16_to_cpu(*(unsigned short *)(pbuf))) & 0xf)
#define SetEOSP(pbuf, eosp) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16( (eosp & 1) << 4); \
*(__le16 *)(pbuf) |= cpu_to_le16( (eosp & 1) << 4); \
} while (0)
#define SetAckpolicy(pbuf, ack) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16( (ack & 3) << 5); \
*(__le16 *)(pbuf) |= cpu_to_le16( (ack & 3) << 5); \
} while (0)
#define GetAckpolicy(pbuf) (((le16_to_cpu(*(unsigned short *)pbuf)) >> 5) & 0x3)
@ -403,7 +403,7 @@ enum WIFI_REG_DOMAIN {
#define SetAMsdu(pbuf, amsdu) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16( (amsdu & 1) << 7); \
*(__le16 *)(pbuf) |= cpu_to_le16( (amsdu & 1) << 7); \
} while (0)
#define GetAid(pbuf) (cpu_to_le16(*(unsigned short *)((SIZE_PTR)(pbuf) + 2)) & 0x3fff)

View file

@ -23,7 +23,6 @@
#define MAX_IE_SZ 768
#ifdef PLATFORM_LINUX
#define NDIS_802_11_LENGTH_SSID 32
@ -666,5 +665,8 @@ typedef struct _NDIS_802_11_CAPABILITY
} NDIS_802_11_CAPABILITY, *PNDIS_802_11_CAPABILITY;
#endif
u8 key_2char2num(u8 hch, u8 lch);
u8 key_char2num(u8 ch);
u8 str_2char2num(u8 hch, u8 lch);
#endif //#ifndef WLAN_BSSDEF_H_

View file

@ -33,39 +33,11 @@ struct pkt_file {
SIZE_T buf_len;
};
#ifdef PLATFORM_WINDOWS
#ifdef PLATFORM_OS_XP
#ifdef CONFIG_USB_HCI
#include <usb.h>
#include <usbdlib.h>
#include <usbioctl.h>
#ifdef CONFIG_80211N_HT
extern int rtw_ht_enable;
extern int rtw_cbw40_enable;
extern int rtw_ampdu_enable;//for enable tx_ampdu
#endif
#endif
#ifdef CONFIG_GSPI_HCI
#define NR_XMITFRAME 64
#else
#define NR_XMITFRAME 128
#endif
#define ETH_ALEN 6
extern NDIS_STATUS rtw_xmit_entry(
_nic_hdl cnxt,
NDIS_PACKET *pkt,
UINT flags
);
#endif
#ifdef PLATFORM_FREEBSD
#define NR_XMITFRAME 256
extern int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev);
extern void rtw_xmit_entry_wrap (struct ifnet * pifp);
#endif //PLATFORM_FREEBSD
#ifdef PLATFORM_LINUX
#define NR_XMITFRAME 256
@ -77,8 +49,6 @@ struct xmit_buf;
extern int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev);
#endif
void rtw_os_xmit_schedule(_adapter *padapter);
int rtw_os_xmit_resource_alloc(_adapter *padapter, struct xmit_buf *pxmitbuf,u32 alloc_sz);

View file

@ -30,6 +30,7 @@
#include <rtw_ioctl.h>
#include <rtw_ioctl_set.h>
#include <rtw_ioctl_query.h>
#include <rtw_mp_ioctl.h>
//#ifdef CONFIG_MP_INCLUDED
#include <rtw_mp_ioctl.h>
@ -74,10 +75,6 @@
#define MAX_CUSTOM_LEN 64
#define RATE_COUNT 4
#ifdef CONFIG_GLOBAL_UI_PID
extern int ui_pid[3];
#endif
// combo scan
#define WEXT_CSCAN_AMOUNT 9
#define WEXT_CSCAN_BUF_LEN 360
@ -91,10 +88,10 @@ extern int ui_pid[3];
#define WEXT_CSCAN_HOME_DWELL_SECTION 'H'
#define WEXT_CSCAN_TYPE_SECTION 'T'
extern u8 key_2char2num(u8 hch, u8 lch);
extern u8 str_2char2num(u8 hch, u8 lch);
extern u8 convert_ip_addr(u8 hch, u8 mch, u8 lch);
static u8 convert_ip_addr(u8 hch, u8 mch, u8 lch)
{
return ((key_char2num(hch) * 100) + (key_char2num(mch) * 10 ) + key_char2num(lch));
}
static u32 rtw_rates[] = {1000000,2000000,5500000,11000000,
6000000,9000000,12000000,18000000,24000000,36000000,48000000,54000000};
@ -336,7 +333,7 @@ static char *translate_scan(_adapter *padapter,
// If not, the driver should ignore this AP and go to the next AP.
// Verifying the SSID
if (_rtw_memcmp(pnetwork->network.Ssid.Ssid, pwdinfo->p2p_wildcard_ssid, P2P_WILDCARD_SSID_LEN))
if (!memcmp(pnetwork->network.Ssid.Ssid, pwdinfo->p2p_wildcard_ssid, P2P_WILDCARD_SSID_LEN))
{
u32 p2pielen = 0;
@ -981,7 +978,7 @@ _func_enter_;
if (param->u.crypt.set_tx == 1)
{
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {
if (_rtw_memcmp(pWapiSta->PeerMacAddr,param->sta_addr,6))
if (!memcmp(pWapiSta->PeerMacAddr,param->sta_addr,6))
{
_rtw_memcpy(pWapiSta->lastTxUnicastPN,WapiASUEPNInitialValueSrc,16);
@ -1010,7 +1007,7 @@ _func_enter_;
else
{
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {
if (_rtw_memcmp(pWapiSta->PeerMacAddr,get_bssid(pmlmepriv),6))
if (!memcmp(pWapiSta->PeerMacAddr,get_bssid(pmlmepriv),6))
{
pWapiSta->wapiMsk.bSet = true;
_rtw_memcpy(pWapiSta->wapiMsk.dataKey,param->u.crypt.key,16);
@ -1160,7 +1157,7 @@ static int rtw_set_wpa_ie(_adapter *padapter, char *pie, unsigned short ielen)
{
eid = buf[cnt];
if ((eid==_VENDOR_SPECIFIC_IE_)&&(_rtw_memcmp(&buf[cnt+2], wps_oui, 4)==true))
if ((eid==_VENDOR_SPECIFIC_IE_)&&(!memcmp(&buf[cnt+2], wps_oui, 4)==true))
{
DBG_88E("SET WPS_IE\n");
@ -1446,7 +1443,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,
if (pPMK->cmd == IW_PMKSA_ADD)
{
DBG_88E("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n");
if (_rtw_memcmp(strIssueBssid, strZeroMacAddress, ETH_ALEN) == true)
if (!memcmp(strIssueBssid, strZeroMacAddress, ETH_ALEN) == true)
{
return(intReturn);
}
@ -1459,7 +1456,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,
//overwrite PMKID
for (j=0 ; j<NUM_PMKID_CACHE; j++)
{
if (_rtw_memcmp(psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN) ==true)
if (!memcmp(psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN) ==true)
{ // BSSID is matched, the same AP => rewrite with new PMKID.
DBG_88E("[rtw_wx_set_pmkid] BSSID exists in the PMKList.\n");
@ -1495,7 +1492,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,
intReturn = true;
for (j=0 ; j<NUM_PMKID_CACHE; j++)
{
if (_rtw_memcmp(psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN) ==true)
if (!memcmp(psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN) ==true)
{ // BSSID is matched, the same AP => Remove this PMKID information and reset it.
_rtw_memset(psecuritypriv->PMKIDList[ j ].Bssid, 0x00, ETH_ALEN);
psecuritypriv->PMKIDList[ j ].bUsed = false;
@ -1753,7 +1750,7 @@ static int rtw_wx_set_wap(struct net_device *dev,
src_bssid = temp->sa_data;
if ((_rtw_memcmp(dst_bssid, src_bssid, ETH_ALEN)) == true)
if ((!memcmp(dst_bssid, src_bssid, ETH_ALEN)) == true)
{
if (!rtw_set_802_11_infrastructure_mode(padapter, pnetwork->network.InfrastructureMode))
{
@ -2035,7 +2032,7 @@ if (padapter->registrypriv.mp_mode == 1)
#endif
if ( wrqu->data.length >= WEXT_CSCAN_HEADER_SIZE
&& _rtw_memcmp(extra, WEXT_CSCAN_HEADER, WEXT_CSCAN_HEADER_SIZE) == true
&& !memcmp(extra, WEXT_CSCAN_HEADER, WEXT_CSCAN_HEADER_SIZE) == true
)
{
int len = wrqu->data.length -WEXT_CSCAN_HEADER_SIZE;
@ -2407,7 +2404,7 @@ static int rtw_wx_set_essid(struct net_device *dev,
("rtw_wx_set_essid: dst_ssid=%s\n",
pnetwork->network.Ssid.Ssid));
if ((_rtw_memcmp(dst_ssid, src_ssid, ndis_ssid.SsidLength) == true) &&
if ((!memcmp(dst_ssid, src_ssid, ndis_ssid.SsidLength) == true) &&
(pnetwork->network.Ssid.SsidLength==ndis_ssid.SsidLength))
{
RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_,
@ -3406,7 +3403,6 @@ static int rtw_wx_set_channel_plan(struct net_device *dev,
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
struct registry_priv *pregistrypriv = &padapter->registrypriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
extern int rtw_channel_plan;
u8 channel_plan_req = (u8) (*((int *)wrqu));
if (_SUCCESS == rtw_set_chplan_cmd(padapter, channel_plan_req, 1)) {
@ -3864,7 +3860,7 @@ static int rtw_get_ap_info(struct net_device *dev,
}
if (_rtw_memcmp(bssid, pnetwork->network.MacAddress, ETH_ALEN) == true)//BSSID match, then check if supporting wpa/wpa2
if (!memcmp(bssid, pnetwork->network.MacAddress, ETH_ALEN) == true)//BSSID match, then check if supporting wpa/wpa2
{
DBG_88E("BSSID:%pM\n", (bssid));
@ -4530,7 +4526,7 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev,
break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
{
u8 *wpsie;
uint wpsie_len = 0;
@ -4681,7 +4677,7 @@ static int rtw_p2p_get_go_device_address(struct net_device *dev,
break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
{
// Commented by Albert 2011/05/18
// Match the device address located in the P2P IE
@ -4787,18 +4783,18 @@ static int rtw_p2p_get_device_type(struct net_device *dev,
break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
{
u8 *wpsie;
uint wpsie_len = 0;
// The mac address is matched.
if ((wpsie=rtw_get_wps_ie(&pnetwork->network.IEs[ 12 ], pnetwork->network.IELength - 12, NULL, &wpsie_len)))
{
if ((wpsie=rtw_get_wps_ie(&pnetwork->network.IEs[ 12 ],
pnetwork->network.IELength - 12,
NULL, &wpsie_len))) {
rtw_get_wps_attr_content(wpsie, wpsie_len, WPS_ATTR_PRIMARY_DEV_TYPE, dev_type, &dev_type_len);
if (dev_type_len)
{
if (dev_type_len) {
u16 type = 0;
memcpy(&type, dev_type, 2);
@ -4877,7 +4873,7 @@ static int rtw_p2p_get_device_name(struct net_device *dev,
break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
{
u8 *wpsie;
uint wpsie_len = 0;
@ -4965,7 +4961,7 @@ static int rtw_p2p_get_invitation_procedure(struct net_device *dev,
break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
{
// Commented by Albert 20121226
// Match the device address located in the P2P IE
@ -5076,7 +5072,7 @@ static int rtw_p2p_connect(struct net_device *dev,
break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN))
{
uintPeerChannel = pnetwork->network.Configuration.DSConfig;
break;
@ -5241,7 +5237,7 @@ static int rtw_p2p_invite_req(struct net_device *dev,
if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen))
{
// Handle the P2P Device ID attribute of Beacon first
if (_rtw_memcmp(attr_content, pinvite_req_info->peer_macaddr, ETH_ALEN))
if (!memcmp(attr_content, pinvite_req_info->peer_macaddr, ETH_ALEN))
{
uintPeerChannel = pnetwork->network.Configuration.DSConfig;
break;
@ -5250,7 +5246,7 @@ static int rtw_p2p_invite_req(struct net_device *dev,
else if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_INFO, attr_content, &attr_contentlen))
{
// Handle the P2P Device Info attribute of probe response
if (_rtw_memcmp(attr_content, pinvite_req_info->peer_macaddr, ETH_ALEN))
if (!memcmp(attr_content, pinvite_req_info->peer_macaddr, ETH_ALEN))
{
uintPeerChannel = pnetwork->network.Configuration.DSConfig;
break;
@ -5507,7 +5503,7 @@ static int rtw_p2p_set_pc(struct net_device *dev,
{
// Handle the P2P Device ID attribute of Beacon first
printk("[%s] P2P_ATTR_DEVICE_ID\n", __func__);
if (_rtw_memcmp(attr_content, peerMAC, ETH_ALEN))
if (!memcmp(attr_content, peerMAC, ETH_ALEN))
{
uintPeerChannel = pnetwork->network.Configuration.DSConfig;
break;
@ -5517,7 +5513,7 @@ static int rtw_p2p_set_pc(struct net_device *dev,
{
// Handle the P2P Device Info attribute of probe response
printk("[%s] P2P_ATTR_DEVICE_INFO\n", __func__);
if (_rtw_memcmp(attr_content, peerMAC, ETH_ALEN))
if (!memcmp(attr_content, peerMAC, ETH_ALEN))
{
uintPeerChannel = pnetwork->network.Configuration.DSConfig;
break;
@ -5754,19 +5750,19 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
peerMAC[ jj ] = key_2char2num(extra[kk], extra[kk+ 1]);
}
if (_rtw_memcmp(&extra[ 18 ], "display", 7))
if (!memcmp(&extra[ 18 ], "display", 7))
{
pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_DISPLYA;
}
else if (_rtw_memcmp(&extra[ 18 ], "keypad", 7))
else if (!memcmp(&extra[ 18 ], "keypad", 7))
{
pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_KEYPAD;
}
else if (_rtw_memcmp(&extra[ 18 ], "pbc", 3))
else if (!memcmp(&extra[ 18 ], "pbc", 3))
{
pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_PUSH_BUTTON;
}
else if (_rtw_memcmp(&extra[ 18 ], "label", 5))
else if (!memcmp(&extra[ 18 ], "label", 5))
{
pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_LABEL;
}
@ -5805,7 +5801,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen))
{
// Handle the P2P Device ID attribute of Beacon first
if (_rtw_memcmp(attr_content, peerMAC, ETH_ALEN))
if (!memcmp(attr_content, peerMAC, ETH_ALEN))
{
uintPeerChannel = pnetwork->network.Configuration.DSConfig;
break;
@ -5814,7 +5810,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
else if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_INFO, attr_content, &attr_contentlen))
{
// Handle the P2P Device Info attribute of probe response
if (_rtw_memcmp(attr_content, peerMAC, ETH_ALEN))
if (!memcmp(attr_content, peerMAC, ETH_ALEN))
{
uintPeerChannel = pnetwork->network.Configuration.DSConfig;
break;
@ -6004,31 +6000,31 @@ static int rtw_p2p_set(struct net_device *dev,
DBG_88E("[%s] extra = %s\n", __func__, extra);
if (_rtw_memcmp(extra, "enable=", 7))
if (!memcmp(extra, "enable=", 7))
{
rtw_wext_p2p_enable(dev, info, wrqu, &extra[7]);
}
else if (_rtw_memcmp(extra, "setDN=", 6))
else if (!memcmp(extra, "setDN=", 6))
{
wrqu->data.length -= 6;
rtw_p2p_setDN(dev, info, wrqu, &extra[6]);
}
else if (_rtw_memcmp(extra, "profilefound=", 13))
else if (!memcmp(extra, "profilefound=", 13))
{
wrqu->data.length -= 13;
rtw_p2p_profilefound(dev, info, wrqu, &extra[13]);
}
else if (_rtw_memcmp(extra, "prov_disc=", 10))
else if (!memcmp(extra, "prov_disc=", 10))
{
wrqu->data.length -= 10;
rtw_p2p_prov_disc(dev, info, wrqu, &extra[10]);
}
else if (_rtw_memcmp(extra, "nego=", 5))
else if (!memcmp(extra, "nego=", 5))
{
wrqu->data.length -= 5;
rtw_p2p_connect(dev, info, wrqu, &extra[5]);
}
else if (_rtw_memcmp(extra, "intent=", 7))
else if (!memcmp(extra, "intent=", 7))
{
// Commented by Albert 2011/03/23
// The wrqu->data.length will include the null character
@ -6036,17 +6032,17 @@ static int rtw_p2p_set(struct net_device *dev,
wrqu->data.length -= 8;
rtw_p2p_set_intent(dev, info, wrqu, &extra[7]);
}
else if (_rtw_memcmp(extra, "ssid=", 5))
else if (!memcmp(extra, "ssid=", 5))
{
wrqu->data.length -= 5;
rtw_p2p_set_go_nego_ssid(dev, info, wrqu, &extra[5]);
}
else if (_rtw_memcmp(extra, "got_wpsinfo=", 12))
else if (!memcmp(extra, "got_wpsinfo=", 12))
{
wrqu->data.length -= 12;
rtw_p2p_got_wpsinfo(dev, info, wrqu, &extra[12]);
}
else if (_rtw_memcmp(extra, "listen_ch=", 10))
else if (!memcmp(extra, "listen_ch=", 10))
{
// Commented by Albert 2011/05/24
// The wrqu->data.length will include the null character
@ -6054,7 +6050,7 @@ static int rtw_p2p_set(struct net_device *dev,
wrqu->data.length -= 11;
rtw_p2p_set_listen_ch(dev, info, wrqu, &extra[10]);
}
else if (_rtw_memcmp(extra, "op_ch=", 6))
else if (!memcmp(extra, "op_ch=", 6))
{
// Commented by Albert 2011/05/24
// The wrqu->data.length will include the null character
@ -6062,36 +6058,36 @@ static int rtw_p2p_set(struct net_device *dev,
wrqu->data.length -= 7;
rtw_p2p_set_op_ch(dev, info, wrqu, &extra[6]);
}
else if (_rtw_memcmp(extra, "invite=", 7))
else if (!memcmp(extra, "invite=", 7))
{
wrqu->data.length -= 8;
rtw_p2p_invite_req(dev, info, wrqu, &extra[7]);
}
else if (_rtw_memcmp(extra, "persistent=", 11))
else if (!memcmp(extra, "persistent=", 11))
{
wrqu->data.length -= 11;
rtw_p2p_set_persistent(dev, info, wrqu, &extra[11]);
}
#ifdef CONFIG_WFD
else if (_rtw_memcmp(extra, "sa=", 3))
else if (!memcmp(extra, "sa=", 3))
{
// sa: WFD Session Available information
wrqu->data.length -= 3;
rtw_p2p_set_sa(dev, info, wrqu, &extra[3]);
}
else if (_rtw_memcmp(extra, "pc=", 3))
else if (!memcmp(extra, "pc=", 3))
{
// pc: WFD Preferred Connection
wrqu->data.length -= 3;
rtw_p2p_set_pc(dev, info, wrqu, &extra[3]);
}
else if (_rtw_memcmp(extra, "wfd_type=", 9))
else if (!memcmp(extra, "wfd_type=", 9))
{
// Specify this device is Mircast source or sink
wrqu->data.length -= 9;
rtw_p2p_set_wfd_device_type(dev, info, wrqu, &extra[9]);
}
else if (_rtw_memcmp(extra, "scan_type=", 10))
else if (!memcmp(extra, "scan_type=", 10))
{
wrqu->data.length -= 10;
rtw_p2p_set_scan_result_type(dev, info, wrqu, &extra[10]);
@ -6120,55 +6116,33 @@ static int rtw_p2p_get(struct net_device *dev,
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
if (padapter->bShowGetP2PState)
{
DBG_88E("[%s] extra = %s\n", __func__, (char*) wrqu->data.pointer);
}
if (_rtw_memcmp(wrqu->data.pointer, "status", 6))
{
if (!memcmp(wrqu->data.pointer, "status", 6)) {
rtw_p2p_get_status(dev, info, wrqu, extra);
}
else if (_rtw_memcmp(wrqu->data.pointer, "role", 4))
{
} else if (!memcmp(wrqu->data.pointer, "role", 4)) {
rtw_p2p_get_role(dev, info, wrqu, extra);
}
else if (_rtw_memcmp(wrqu->data.pointer, "peer_ifa", 8))
{
} else if (!memcmp(wrqu->data.pointer, "peer_ifa", 8)) {
rtw_p2p_get_peer_ifaddr(dev, info, wrqu, extra);
}
else if (_rtw_memcmp(wrqu->data.pointer, "req_cm", 6))
{
} else if (!memcmp(wrqu->data.pointer, "req_cm", 6)) {
rtw_p2p_get_req_cm(dev, info, wrqu, extra);
}
else if (_rtw_memcmp(wrqu->data.pointer, "peer_deva", 9))
{
} else if (!memcmp(wrqu->data.pointer, "peer_deva", 9)) {
// Get the P2P device address when receiving the provision discovery request frame.
rtw_p2p_get_peer_devaddr(dev, info, wrqu, extra);
}
else if (_rtw_memcmp(wrqu->data.pointer, "group_id", 8))
{
} else if (!memcmp(wrqu->data.pointer, "group_id", 8)) {
rtw_p2p_get_groupid(dev, info, wrqu, extra);
}
else if (_rtw_memcmp(wrqu->data.pointer, "peer_deva_inv", 9))
{
} else if (!memcmp(wrqu->data.pointer, "peer_deva_inv", 9)) {
// Get the P2P device address when receiving the P2P Invitation request frame.
rtw_p2p_get_peer_devaddr_by_invitation(dev, info, wrqu, extra);
}
else if (_rtw_memcmp(wrqu->data.pointer, "op_ch", 5))
{
} else if (!memcmp(wrqu->data.pointer, "op_ch", 5)) {
rtw_p2p_get_op_ch(dev, info, wrqu, extra);
}
#ifdef CONFIG_WFD
else if (_rtw_memcmp(wrqu->data.pointer, "peer_port", 9))
{
else if (!memcmp(wrqu->data.pointer, "peer_port", 9)) {
rtw_p2p_get_peer_wfd_port(dev, info, wrqu, extra);
}
else if (_rtw_memcmp(wrqu->data.pointer, "wfd_sa", 6))
{
} else if (!memcmp(wrqu->data.pointer, "wfd_sa", 6)) {
rtw_p2p_get_peer_wfd_session_available(dev, info, wrqu, extra);
}
else if (_rtw_memcmp(wrqu->data.pointer, "wfd_pc", 6))
{
} else if (!memcmp(wrqu->data.pointer, "wfd_pc", 6)) {
rtw_p2p_get_peer_wfd_preferred_connection(dev, info, wrqu, extra);
}
#endif // CONFIG_WFD
@ -6176,7 +6150,6 @@ static int rtw_p2p_get(struct net_device *dev,
#endif //CONFIG_P2P
return ret;
}
static int rtw_p2p_get2(struct net_device *dev,
@ -6196,27 +6169,27 @@ static int rtw_p2p_get2(struct net_device *dev,
DBG_88E("[%s] extra = %s\n", __func__, (char *)wrqu->data.pointer);
if (_rtw_memcmp(extra, "wpsCM=", 6))
if (!memcmp(extra, "wpsCM=", 6))
{
wrqu->data.length -= 6;
rtw_p2p_get_wps_configmethod(dev, info, wrqu, &extra[6]);
}
else if (_rtw_memcmp(extra, "devN=", 5))
else if (!memcmp(extra, "devN=", 5))
{
wrqu->data.length -= 5;
rtw_p2p_get_device_name(dev, info, wrqu, &extra[5]);
}
else if (_rtw_memcmp(extra, "dev_type=", 9))
else if (!memcmp(extra, "dev_type=", 9))
{
wrqu->data.length -= 9;
rtw_p2p_get_device_type(dev, info, wrqu, &extra[9]);
}
else if (_rtw_memcmp(extra, "go_devadd=", 10))
else if (!memcmp(extra, "go_devadd=", 10))
{
wrqu->data.length -= 10;
rtw_p2p_get_go_device_address(dev, info, wrqu, &extra[10]);
}
else if (_rtw_memcmp(extra, "InvProc=", 8))
else if (!memcmp(extra, "InvProc=", 8))
{
wrqu->data.length -= 8;
rtw_p2p_get_invitation_procedure(dev, info, wrqu, &extra[8]);
@ -6257,8 +6230,6 @@ static int rtw_cta_test_start(struct net_device *dev,
return ret;
}
extern int rtw_change_ifname(_adapter *padapter, const char *ifname);
static int rtw_rereg_nd_name(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
@ -6298,7 +6269,7 @@ static int rtw_rereg_nd_name(struct net_device *dev,
goto exit;
}
if (_rtw_memcmp(rereg_priv->old_ifname, "disable%d", 9) == true) {
if (!memcmp(rereg_priv->old_ifname, "disable%d", 9) == true) {
padapter->ledpriv.bRegUseLed= rereg_priv->old_bRegUseLed;
rtw_hal_sw_led_init(padapter);
rtw_ips_mode_req(&padapter->pwrctrlpriv, rereg_priv->old_ips_mode);
@ -6307,7 +6278,7 @@ static int rtw_rereg_nd_name(struct net_device *dev,
strncpy(rereg_priv->old_ifname, new_ifname, IFNAMSIZ);
rereg_priv->old_ifname[IFNAMSIZ-1] = 0;
if (_rtw_memcmp(new_ifname, "disable%d", 9) == true) {
if (!memcmp(new_ifname, "disable%d", 9) == true) {
DBG_88E("%s disable\n", __func__);
// free network queue for Android's timming issue
@ -8417,7 +8388,7 @@ static int rtw_wx_set_priv(struct net_device *dev,
u8 wps_oui[4]={0x0,0x50,0xf2,0x04};
if ((_VENDOR_SPECIFIC_IE_ == probereq_wpsie[0]) &&
(_rtw_memcmp(&probereq_wpsie[2], wps_oui, 4) ==true))
(!memcmp(&probereq_wpsie[2], wps_oui, 4) ==true))
{
cp_sz = probereq_wpsie_len>MAX_WPS_IE_LEN ? MAX_WPS_IE_LEN:probereq_wpsie_len;
@ -8449,7 +8420,7 @@ static int rtw_wx_set_priv(struct net_device *dev,
}
if ( len >= WEXT_CSCAN_HEADER_SIZE
&& _rtw_memcmp(ext, WEXT_CSCAN_HEADER, WEXT_CSCAN_HEADER_SIZE) == true
&& !memcmp(ext, WEXT_CSCAN_HEADER, WEXT_CSCAN_HEADER_SIZE) == true
){
ret = rtw_wx_set_scan(dev, info, awrq, ext);
goto FREE_EXT;
@ -8553,12 +8524,12 @@ static int rtw_pm_set(struct net_device *dev,
DBG_88E("[%s] extra = %s\n", __func__, extra);
if (_rtw_memcmp(extra, "lps=", 4))
if (!memcmp(extra, "lps=", 4))
{
sscanf(extra+4, "%u", &mode);
ret = rtw_pm_set_lps(padapter,mode);
}
else if (_rtw_memcmp(extra, "ips=", 4))
else if (!memcmp(extra, "ips=", 4))
{
sscanf(extra+4, "%u", &mode);
ret = rtw_pm_set_ips(padapter,mode);
@ -11124,7 +11095,7 @@ static int rtw_tdls_enable(struct net_device *dev,
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
for (index=0; index< NUM_STA; index++) {
if (!_rtw_memcmp(tdls_sta[index], empty_hwaddr, ETH_ALEN)) {
if (!!memcmp(tdls_sta[index], empty_hwaddr, ETH_ALEN)) {
pr_info("issue tear down to %pM\n", tdls_sta[index]);
issue_tdls_teardown(padapter, tdls_sta[index]);
}
@ -11548,19 +11519,19 @@ static int rtw_tdls(struct net_device *dev,
DBG_88E("[%s] extra = %s\n", __func__, extra);
// WFD Sigma will use the tdls enable command to let the driver know we want to test the tdls now!
if (_rtw_memcmp(extra, "wfdenable=", 10))
if (!memcmp(extra, "wfdenable=", 10))
{
wrqu->data.length -=10;
rtw_wfd_tdls_enable(dev, info, wrqu, &extra[10]);
return ret;
}
else if (_rtw_memcmp(extra, "weaksec=", 8))
else if (!memcmp(extra, "weaksec=", 8))
{
wrqu->data.length -=8;
rtw_tdls_weaksec(dev, info, wrqu, &extra[8]);
return ret;
}
else if (_rtw_memcmp(extra, "tdlsenable=", 11))
else if (!memcmp(extra, "tdlsenable=", 11))
{
wrqu->data.length -=11;
rtw_tdls_enable(dev, info, wrqu, &extra[11]);
@ -11573,48 +11544,48 @@ static int rtw_tdls(struct net_device *dev,
return 0;
}
if (_rtw_memcmp(extra, "setup=", 6))
if (!memcmp(extra, "setup=", 6))
{
wrqu->data.length -=6;
rtw_tdls_setup(dev, info, wrqu, &extra[6]);
}
else if (_rtw_memcmp(extra, "tear=", 5))
else if (!memcmp(extra, "tear=", 5))
{
wrqu->data.length -= 5;
rtw_tdls_teardown(dev, info, wrqu, &extra[5]);
}
else if (_rtw_memcmp(extra, "dis=", 4))
else if (!memcmp(extra, "dis=", 4))
{
wrqu->data.length -= 4;
rtw_tdls_discovery(dev, info, wrqu, &extra[4]);
}
else if (_rtw_memcmp(extra, "sw=", 3))
else if (!memcmp(extra, "sw=", 3))
{
wrqu->data.length -= 3;
rtw_tdls_ch_switch (dev, info, wrqu, &extra[3]);
}
else if (_rtw_memcmp(extra, "swoff=", 6))
else if (!memcmp(extra, "swoff=", 6))
{
wrqu->data.length -= 6;
rtw_tdls_ch_switch_off(dev, info, wrqu, &extra[6]);
}
else if (_rtw_memcmp(extra, "pson=", 5))
else if (!memcmp(extra, "pson=", 5))
{
wrqu->data.length -= 5;
rtw_tdls_pson(dev, info, wrqu, &extra[5]);
}
else if (_rtw_memcmp(extra, "psoff=", 6))
else if (!memcmp(extra, "psoff=", 6))
{
wrqu->data.length -= 6;
rtw_tdls_psoff(dev, info, wrqu, &extra[6]);
}
#ifdef CONFIG_WFD
else if (_rtw_memcmp(extra, "setip=", 6))
else if (!memcmp(extra, "setip=", 6))
{
wrqu->data.length -= 6;
rtw_tdls_setip(dev, info, wrqu, &extra[6]);
}
else if (_rtw_memcmp(extra, "tprobe=", 6))
else if (!memcmp(extra, "tprobe=", 6))
{
issue_tunneled_probe_req((_adapter *)rtw_netdev_priv(dev));
}
@ -11636,20 +11607,20 @@ static int rtw_tdls_get(struct net_device *dev,
DBG_88E("[%s] extra = %s\n", __func__, (char*) wrqu->data.pointer);
if (_rtw_memcmp(wrqu->data.pointer, "ip", 2))
if (!memcmp(wrqu->data.pointer, "ip", 2))
{
rtw_tdls_getip(dev, info, wrqu, extra);
}
if (_rtw_memcmp(wrqu->data.pointer, "port", 4))
if (!memcmp(wrqu->data.pointer, "port", 4))
{
rtw_tdls_getport(dev, info, wrqu, extra);
}
//WFDTDLS, for sigma test
if (_rtw_memcmp(wrqu->data.pointer, "dis", 3))
if (!memcmp(wrqu->data.pointer, "dis", 3))
{
rtw_tdls_dis_result(dev, info, wrqu, extra);
}
if (_rtw_memcmp(wrqu->data.pointer, "status", 6))
if (!memcmp(wrqu->data.pointer, "status", 6))
{
rtw_wfd_tdls_status(dev, info, wrqu, extra);
}
@ -12043,8 +12014,8 @@ static u8 pktcmp(PADAPTER padapter, u8 *txbuf, u32 txsz, u8 *rxbuf, u32 rxsz)
__func__, txsz - TXDESC_SIZE, rxpktsize - fcssize);
ret = false;
} else {
ret = _rtw_memcmp(txbuf + TXDESC_SIZE,\
rxbuf + RXDESC_SIZE + drvinfosize,\
ret = !memcmp(txbuf + TXDESC_SIZE,
rxbuf + RXDESC_SIZE + drvinfosize,
txsz - TXDESC_SIZE);
if (ret == false) {
DBG_88E("%s: ERROR! pkt content mismatch!\n", __func__);

View file

@ -91,7 +91,7 @@ void _rtw_scan_timeout_handler (void *FunctionContext)
}
void _dynamic_check_timer_handlder (void *FunctionContext)
static void _dynamic_check_timer_handlder (void *FunctionContext)
{
_adapter *adapter = (_adapter *)FunctionContext;
@ -298,20 +298,20 @@ _func_exit_;
}
void _survey_timer_hdl (void *FunctionContext)
static void _survey_timer_hdl (void *FunctionContext)
{
_adapter *padapter = (_adapter *)FunctionContext;
survey_timer_hdl(padapter);
}
void _link_timer_hdl (void *FunctionContext)
static void _link_timer_hdl (void *FunctionContext)
{
_adapter *padapter = (_adapter *)FunctionContext;
link_timer_hdl(padapter);
}
void _addba_timer_hdl(void *FunctionContext)
static void _addba_timer_hdl(void *FunctionContext)
{
struct sta_info *psta = (struct sta_info *)FunctionContext;
addba_timer_hdl(psta);

View file

@ -53,82 +53,82 @@ MODULE_AUTHOR("Realtek Semiconductor Corp.");
MODULE_VERSION(DRIVERVERSION);
/* module param defaults */
int rtw_chip_version = 0x00;
int rtw_rfintfs = HWPI;
int rtw_lbkmode = 0;//RTL8712_AIR_TRX;
static int rtw_chip_version = 0x00;
static int rtw_rfintfs = HWPI;
static int rtw_lbkmode = 0;//RTL8712_AIR_TRX;
int rtw_network_mode = Ndis802_11IBSS;//Ndis802_11Infrastructure;//infra, ad-hoc, auto
int rtw_channel = 1;//ad-hoc support requirement
int rtw_wireless_mode = WIRELESS_11BG_24N;
int rtw_vrtl_carrier_sense = AUTO_VCS;
int rtw_vcs_type = RTS_CTS;//*
int rtw_rts_thresh = 2347;//*
int rtw_frag_thresh = 2346;//*
int rtw_preamble = PREAMBLE_LONG;//long, short, auto
int rtw_scan_mode = 1;//active, passive
int rtw_adhoc_tx_pwr = 1;
int rtw_soft_ap = 0;
static int rtw_network_mode = Ndis802_11IBSS;//Ndis802_11Infrastructure;//infra, ad-hoc, auto
static int rtw_channel = 1;//ad-hoc support requirement
static int rtw_wireless_mode = WIRELESS_11BG_24N;
static int rtw_vrtl_carrier_sense = AUTO_VCS;
static int rtw_vcs_type = RTS_CTS;//*
static int rtw_rts_thresh = 2347;//*
static int rtw_frag_thresh = 2346;//*
static int rtw_preamble = PREAMBLE_LONG;//long, short, auto
static int rtw_scan_mode = 1;//active, passive
static int rtw_adhoc_tx_pwr = 1;
static int rtw_soft_ap = 0;
#ifdef CONFIG_POWER_SAVING
int rtw_power_mgnt = 1;
static int rtw_power_mgnt = 1;
#ifdef CONFIG_IPS_LEVEL_2
int rtw_ips_mode = IPS_LEVEL_2;
static int rtw_ips_mode = IPS_LEVEL_2;
#else
int rtw_ips_mode = IPS_NORMAL;
static int rtw_ips_mode = IPS_NORMAL;
#endif
#else
int rtw_power_mgnt = PS_MODE_ACTIVE;
int rtw_ips_mode = IPS_NONE;
static int rtw_power_mgnt = PS_MODE_ACTIVE;
static int rtw_ips_mode = IPS_NONE;
#endif
int rtw_smart_ps = 2;
static int rtw_smart_ps = 2;
#ifdef CONFIG_TX_EARLY_MODE
int rtw_early_mode=1;
static int rtw_early_mode=1;
#endif
module_param(rtw_ips_mode, int, 0644);
MODULE_PARM_DESC(rtw_ips_mode,"The default IPS mode");
static int rtw_debug = 1;
int rtw_radio_enable = 1;
int rtw_long_retry_lmt = 7;
int rtw_short_retry_lmt = 7;
int rtw_busy_thresh = 40;
int rtw_ack_policy = NORMAL_ACK;
static int rtw_radio_enable = 1;
static int rtw_long_retry_lmt = 7;
static int rtw_short_retry_lmt = 7;
static int rtw_busy_thresh = 40;
static int rtw_ack_policy = NORMAL_ACK;
int rtw_mp_mode = 0;
static int rtw_mp_mode = 0;
int rtw_software_encrypt = 0;
int rtw_software_decrypt = 0;
static int rtw_software_encrypt = 0;
static int rtw_software_decrypt = 0;
int rtw_acm_method = 0;// 0:By SW 1:By HW.
static int rtw_acm_method = 0;// 0:By SW 1:By HW.
int rtw_wmm_enable = 1;// default is set to enable the wmm.
int rtw_uapsd_enable = 0;
int rtw_uapsd_max_sp = NO_LIMIT;
int rtw_uapsd_acbk_en = 0;
int rtw_uapsd_acbe_en = 0;
int rtw_uapsd_acvi_en = 0;
int rtw_uapsd_acvo_en = 0;
static int rtw_wmm_enable = 1;// default is set to enable the wmm.
static int rtw_uapsd_enable = 0;
static int rtw_uapsd_max_sp = NO_LIMIT;
static int rtw_uapsd_acbk_en = 0;
static int rtw_uapsd_acbe_en = 0;
static int rtw_uapsd_acvi_en = 0;
static int rtw_uapsd_acvo_en = 0;
#ifdef CONFIG_80211N_HT
int rtw_ht_enable = 1;
int rtw_cbw40_enable = 3; // 0 :diable, bit(0): enable 2.4g, bit(1): enable 5g
int rtw_ampdu_enable = 1;//for enable tx_ampdu
int rtw_rx_stbc = 1;// 0: disable, bit(0):enable 2.4g, bit(1):enable 5g, default is set to enable 2.4GHZ for IOT issue with bufflao's AP at 5GHZ
int rtw_ampdu_amsdu = 0;// 0: disabled, 1:enabled, 2:auto
static int rtw_rx_stbc = 1;// 0: disable, bit(0):enable 2.4g, bit(1):enable 5g, default is set to enable 2.4GHZ for IOT issue with bufflao's AP at 5GHZ
static int rtw_ampdu_amsdu = 0;// 0: disabled, 1:enabled, 2:auto
#endif
int rtw_lowrate_two_xmit = 1;//Use 2 path Tx to transmit MCS0~7 and legacy mode
static int rtw_lowrate_two_xmit = 1;//Use 2 path Tx to transmit MCS0~7 and legacy mode
int rtw_rf_config = RF_819X_MAX_TYPE; //auto
int rtw_low_power = 0;
static int rtw_rf_config = RF_819X_MAX_TYPE; //auto
static int rtw_low_power = 0;
#ifdef CONFIG_WIFI_TEST
int rtw_wifi_spec = 1;//for wifi test
static int rtw_wifi_spec = 1;//for wifi test
#else
int rtw_wifi_spec = 0;
static int rtw_wifi_spec = 0;
#endif
int rtw_channel_plan = RT_CHANNEL_DOMAIN_MAX;
static int rtw_channel_plan = RT_CHANNEL_DOMAIN_MAX;
#ifdef CONFIG_BT_COEXIST
int rtw_btcoex_enable = 1;
@ -137,29 +137,29 @@ int rtw_bt_sco = 3;// 0:Idle, 1:None-SCO, 2:SCO, 3:From Counter, 4.Busy, 5.Other
int rtw_bt_ampdu =1 ;// 0:Disable BT control A-MPDU, 1:Enable BT control A-MPDU.
#endif
int rtw_AcceptAddbaReq = true;// 0:Reject AP's Add BA req, 1:Accept AP's Add BA req.
static int rtw_AcceptAddbaReq = true;// 0:Reject AP's Add BA req, 1:Accept AP's Add BA req.
int rtw_antdiv_cfg = 2; // 0:OFF , 1:ON, 2:decide by Efuse config
int rtw_antdiv_type = 0 ; //0:decide by efuse 1: for 88EE, 1Tx and 1RxCG are diversity.(2 Ant with SPDT), 2: for 88EE, 1Tx and 2Rx are diversity.( 2 Ant, Tx and RxCG are both on aux port, RxCS is on main port ), 3: for 88EE, 1Tx and 1RxCG are fixed.(1Ant, Tx and RxCG are both on aux port)
static int rtw_antdiv_cfg = 2; // 0:OFF , 1:ON, 2:decide by Efuse config
static int rtw_antdiv_type = 0 ; //0:decide by efuse 1: for 88EE, 1Tx and 1RxCG are diversity.(2 Ant with SPDT), 2: for 88EE, 1Tx and 2Rx are diversity.( 2 Ant, Tx and RxCG are both on aux port, RxCS is on main port ), 3: for 88EE, 1Tx and 1RxCG are fixed.(1Ant, Tx and RxCG are both on aux port)
#ifdef CONFIG_USB_AUTOSUSPEND
int rtw_enusbss = 1;//0:disable,1:enable
static int rtw_enusbss = 1;//0:disable,1:enable
#else
int rtw_enusbss = 0;//0:disable,1:enable
static int rtw_enusbss = 0;//0:disable,1:enable
#endif
int rtw_hwpdn_mode=2;//0:disable,1:enable,2: by EFUSE config
static int rtw_hwpdn_mode=2;//0:disable,1:enable,2: by EFUSE config
#ifdef CONFIG_HW_PWRP_DETECTION
int rtw_hwpwrp_detect = 1;
static int rtw_hwpwrp_detect = 1;
#else
int rtw_hwpwrp_detect = 0; //HW power ping detect 0:disable , 1:enable
static int rtw_hwpwrp_detect = 0; //HW power ping detect 0:disable , 1:enable
#endif
#ifdef CONFIG_USB_HCI
int rtw_hw_wps_pbc = 1;
static int rtw_hw_wps_pbc = 1;
#else
int rtw_hw_wps_pbc = 0;
static int rtw_hw_wps_pbc = 0;
#endif
#ifdef CONFIG_TX_MCAST2UNI
@ -171,7 +171,7 @@ int rtw_dmsp = 0;
#endif // CONFIG_DUALMAC_CONCURRENT
#ifdef CONFIG_80211D
int rtw_80211d = 0;
static int rtw_80211d = 0;
#endif
#ifdef CONFIG_SPECIAL_SETTING_FOR_FUNAI_TV
@ -181,15 +181,15 @@ module_param(rtw_force_ant, int, 0644);
module_param(rtw_force_igi, int, 0644);
#endif
char* ifname = "wlan%d";
static char* ifname = "wlan%d";
module_param(ifname, charp, 0644);
MODULE_PARM_DESC(ifname, "The default name to allocate for first interface");
char* if2name = "wlan%d";
static char* if2name = "wlan%d";
module_param(if2name, charp, 0644);
MODULE_PARM_DESC(if2name, "The default name to allocate for second interface");
char* rtw_initmac = 0; // temp mac address if users want to use instead of the mac address in Efuse
char* rtw_initmac = NULL; // temp mac address if users want to use instead of the mac address in Efuse
module_param(rtw_initmac, charp, 0644);
module_param(rtw_channel_plan, int, 0644);
@ -233,13 +233,13 @@ MODULE_PARM_DESC(rtw_adaptor_info_caching_file_path, "The path of adapter info c
#endif //CONFIG_ADAPTOR_INFO_CACHING_FILE
#ifdef CONFIG_LAYER2_ROAMING
uint rtw_max_roaming_times=2;
static uint rtw_max_roaming_times=2;
module_param(rtw_max_roaming_times, uint, 0644);
MODULE_PARM_DESC(rtw_max_roaming_times,"The max roaming times to try");
#endif //CONFIG_LAYER2_ROAMING
#ifdef CONFIG_IOL
int rtw_fw_iol=1;// 0:Disable, 1:enable, 2:by usb speed
static int rtw_fw_iol=1;// 0:Disable, 1:enable, 2:by usb speed
module_param(rtw_fw_iol, int, 0644);
MODULE_PARM_DESC(rtw_fw_iol,"FW IOL");
#endif //CONFIG_IOL
@ -268,13 +268,12 @@ module_param(rtw_btcoex_enable, int, 0644);
MODULE_PARM_DESC(rtw_btcoex_enable, "Enable BT co-existence mechanism");
#endif
uint rtw_notch_filter = RTW_NOTCH_FILTER;
static uint rtw_notch_filter = RTW_NOTCH_FILTER;
module_param(rtw_notch_filter, uint, 0644);
MODULE_PARM_DESC(rtw_notch_filter, "0:Disable, 1:Enable, 2:Enable only for P2P");
module_param_named(debug, rtw_debug, int, 0444);
MODULE_PARM_DESC(debug, "Set debug level (1-9) (default 1)");
static uint loadparam(PADAPTER padapter, _nic_hdl pnetdev);
int _netdev_open(struct net_device *pnetdev);
int netdev_open (struct net_device *pnetdev);
static int netdev_close (struct net_device *pnetdev);
@ -674,7 +673,7 @@ void rtw_proc_remove_one(struct net_device *dev)
#endif
#endif
uint loadparam( _adapter *padapter, _nic_hdl pnetdev)
static uint loadparam( _adapter *padapter, _nic_hdl pnetdev)
{
uint status = _SUCCESS;
@ -824,7 +823,7 @@ static struct net_device_stats *rtw_net_get_stats(struct net_device *pnetdev)
static const u16 rtw_1d_to_queue[8] = { 2, 3, 3, 2, 1, 1, 0, 0 };
/* Given a data frame determine the 802.1p/1d tag to use. */
unsigned int rtw_classify8021d(struct sk_buff *skb)
static unsigned int rtw_classify8021d(struct sk_buff *skb)
{
unsigned int dscp;
@ -864,7 +863,7 @@ u16 rtw_recv_select_queue(struct sk_buff *skb)
{
struct iphdr *piphdr;
unsigned int dscp;
u16 eth_type;
__be16 eth_type;
u32 priority;
u8 *pdata = skb->data;
@ -1072,7 +1071,7 @@ void rtw_stop_drv_threads (_adapter *padapter)
rtw_hal_stop_thread(padapter);
}
u8 rtw_init_default_value(_adapter *padapter)
static u8 rtw_init_default_value(_adapter *padapter)
{
u8 ret = _SUCCESS;
struct registry_priv* pregistrypriv = &padapter->registrypriv;
@ -1903,7 +1902,7 @@ int netdev_open(struct net_device *pnetdev)
}
#ifdef CONFIG_IPS
int ips_netdrv_open(_adapter *padapter)
static int ips_netdrv_open(_adapter *padapter)
{
int status = _SUCCESS;
padapter->net_closed = false;
@ -1971,7 +1970,7 @@ void rtw_ips_dev_unload(_adapter *padapter)
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
DBG_88E("====> %s...\n",__func__);
rtw_hal_set_hwreg(padapter, HW_VAR_FIFO_CLEARN_UP, 0);
rtw_hal_set_hwreg(padapter, HW_VAR_FIFO_CLEARN_UP, NULL);
if (padapter->intf_stop)
padapter->intf_stop(padapter);

View file

@ -26,14 +26,13 @@
#include <drv_types.h>
#include <recv_osdep.h>
#include <linux/vmalloc.h>
#include <rtw_ioctl_set.h>
#ifdef RTK_DMP_PLATFORM
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12))
#include <linux/pageremap.h>
#endif
#endif
#define RT_TAG '1178'
/*
* Translate the OS dependent @param error_code to OS independent RTW_STATUS_CODE
* @return: one of RTW_STATUS_CODE
@ -242,26 +241,6 @@ void _rtw_spinlock_free(_lock *plock)
{
}
void _rtw_spinlock(_lock *plock)
{
spin_lock(plock);
}
void _rtw_spinunlock(_lock *plock)
{
spin_unlock(plock);
}
void _rtw_spinlock_ex(_lock *plock)
{
spin_lock(plock);
}
void _rtw_spinunlock_ex(_lock *plock)
{
spin_unlock(plock);
}
void _rtw_init_queue(_queue *pqueue)
{
_rtw_init_listhead(&(pqueue->queue));
@ -359,7 +338,7 @@ void rtw_udelay_os(int us)
}
#endif
void rtw_yield_os()
void rtw_yield_os(void)
{
yield();
}
@ -374,7 +353,7 @@ static android_suspend_lock_t rtw_suspend_lock ={
};
#endif
inline void rtw_suspend_lock_init()
inline void rtw_suspend_lock_init(void)
{
#ifdef CONFIG_WAKELOCK
wake_lock_init(&rtw_suspend_lock, WAKE_LOCK_SUSPEND, RTW_SUSPEND_LOCK_NAME);
@ -383,7 +362,7 @@ inline void rtw_suspend_lock_init()
#endif
}
inline void rtw_suspend_lock_uninit()
inline void rtw_suspend_lock_uninit(void)
{
#ifdef CONFIG_WAKELOCK
wake_lock_destroy(&rtw_suspend_lock);
@ -392,7 +371,7 @@ inline void rtw_suspend_lock_uninit()
#endif
}
inline void rtw_lock_suspend()
inline void rtw_lock_suspend(void)
{
#ifdef CONFIG_WAKELOCK
wake_lock(&rtw_suspend_lock);
@ -405,7 +384,7 @@ inline void rtw_lock_suspend()
#endif
}
inline void rtw_unlock_suspend()
inline void rtw_unlock_suspend(void)
{
#ifdef CONFIG_WAKELOCK
wake_unlock(&rtw_suspend_lock);

View file

@ -28,10 +28,7 @@
#include <osdep_intf.h>
#include <ethernet.h>
#ifdef CONFIG_USB_HCI
#include <usb_ops.h>
#endif
//init os related resource in struct recv_priv
int rtw_os_recv_resource_init(struct recv_priv *precvpriv, _adapter *padapter)
@ -353,7 +350,6 @@ _func_enter_;
if ( br_port && (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true) )
{
int nat25_handle_frame(_adapter *priv, struct sk_buff *skb);
if (nat25_handle_frame(padapter, skb) == -1) {
//priv->ext_stats.rx_data_drops++;
//DEBUG_ERR("RX DROP: nat25_handle_frame fail!\n");

View file

@ -97,13 +97,7 @@ typedef struct cmd_tlv {
#endif /* PNO_SUPPORT */
typedef struct android_wifi_priv_cmd {
#ifdef CONFIG_COMPAT
compat_uptr_t buf;
#else
char *buf;
#endif
int used_len;
int total_len;
} android_wifi_priv_cmd;
@ -359,7 +353,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
ret = -EFAULT;
goto exit;
}
if (copy_from_user(command, (void *)priv_cmd.buf, priv_cmd.total_len)) {
if (copy_from_user(command, (char __user *)priv_cmd.buf, priv_cmd.total_len)) {
ret = -EFAULT;
goto exit;
}
@ -563,7 +557,7 @@ response:
bytes_written++;
}
priv_cmd.used_len = bytes_written;
if (copy_to_user((void *)priv_cmd.buf, command, bytes_written)) {
if (copy_to_user((char __user *)priv_cmd.buf, command, bytes_written)) {
DBG_88E("%s: failed to copy data to user buffer\n", __func__);
ret = -EFAULT;
}

View file

@ -27,11 +27,13 @@
#include <hal_intf.h>
#include <rtw_version.h>
#include <linux/usb.h>
#include <osdep_intf.h>
#include <usb_vendor_req.h>
#include <usb_ops.h>
#include <usb_osintf.h>
#include <usb_hal.h>
#include <rtw_ioctl.h>
#ifdef CONFIG_PLATFORM_RTK_DMP
#include <asm/io.h>
#endif
@ -42,18 +44,11 @@
#endif
#ifdef CONFIG_80211N_HT
extern int rtw_ht_enable;
extern int rtw_cbw40_enable;
extern int rtw_ampdu_enable;//for enable tx_ampdu
#endif
#ifdef CONFIG_GLOBAL_UI_PID
int ui_pid[3] = {0, 0, 0};
#endif
extern int pm_netdev_open(struct net_device *pnetdev,u8 bnormal);
static int rtw_suspend(struct usb_interface *intf, pm_message_t message);
static int rtw_resume(struct usb_interface *intf);
int rtw_resume_process(_adapter *padapter);
@ -277,7 +272,7 @@ static struct usb_device_id rtw_usb_id_tbl[] ={
};
MODULE_DEVICE_TABLE(usb, rtw_usb_id_tbl);
int const rtw_usb_id_len = sizeof(rtw_usb_id_tbl) / sizeof(struct usb_device_id);
//int const rtw_usb_id_len = sizeof(rtw_usb_id_tbl) / sizeof(struct usb_device_id);
static struct specific_device_id specific_device_id_tbl[] = {
{.idVendor=USB_VENDER_ID_REALTEK, .idProduct=0x8177, .flags=SPEC_DEV_ID_DISABLE_HT},//8188cu 1*1 dongole, (b/g mode only)
@ -382,7 +377,7 @@ static struct usb_device_id rtl8188e_usb_id_tbl[] ={
{} /* Terminating entry */
};
struct rtw_usb_drv rtl8188e_usb_drv = {
static struct rtw_usb_drv rtl8188e_usb_drv = {
.usbdrv.name = (char*)"rtl8188eu",
.usbdrv.probe = rtw_drv_init,
.usbdrv.disconnect = rtw_dev_remove,
@ -1298,9 +1293,9 @@ static int usb_wifi_host = 2;
* We accept the new device by returning 0.
*/
_adapter *rtw_sw_export = NULL;
static _adapter *rtw_sw_export = NULL;
_adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
static _adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
struct usb_interface *pusb_intf, const struct usb_device_id *pdid)
{
_adapter *padapter = NULL;
@ -1468,7 +1463,7 @@ _adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
free_hal_data:
if (status != _SUCCESS && padapter->HalData)
rtw_mfree(padapter->HalData, sizeof(*(padapter->HalData)));
kfree(padapter->HalData);
free_wdev:
if (status != _SUCCESS) {
#ifdef CONFIG_IOCTL_CFG80211

View file

@ -30,6 +30,7 @@
#include <xmit_osdep.h>
#include <osdep_intf.h>
#include <circ_buf.h>
#include <usb_osintf.h>
uint rtw_remainder_len(struct pkt_file *pfile)
{
@ -311,7 +312,7 @@ static void rtw_check_xmit_resource(_adapter *padapter, _pkt *pkt)
}
#ifdef CONFIG_TX_MCAST2UNI
int rtw_mlcst2unicst(_adapter *padapter, struct sk_buff *skb)
static int rtw_mlcst2unicst(_adapter *padapter, struct sk_buff *skb)
{
struct sta_priv *pstapriv = &padapter->stapriv;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
@ -370,7 +371,6 @@ int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev)
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
#ifdef CONFIG_TX_MCAST2UNI
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
extern int rtw_mc2u_disable;
#endif // CONFIG_TX_MCAST2UNI
s32 res = 0;
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))