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: