mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-09 23:19:39 +00:00
rtl8188eu: Fix remaining checkfile errors in hal/*.c
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
f527ca59c9
commit
a311b57c32
12 changed files with 2406 additions and 3138 deletions
File diff suppressed because it is too large
Load diff
|
@ -184,7 +184,7 @@ enum HAL_STATUS ODM_ReadAndConfig_RadioA_1T_8188E(struct odm_dm_struct *pDM_Odm)
|
|||
|
||||
if (biol) {
|
||||
pxmit_frame = rtw_IOL_accquire_xmit_frame(Adapter);
|
||||
if (pxmit_frame== NULL) {
|
||||
if (pxmit_frame == NULL) {
|
||||
pr_info("rtw_IOL_accquire_xmit_frame failed\n");
|
||||
return HAL_STATUS_FAILURE;
|
||||
}
|
||||
|
|
|
@ -212,7 +212,7 @@ u32 rtw_hal_inirp_deinit(struct adapter *adapt)
|
|||
}
|
||||
|
||||
u8 rtw_hal_intf_ps_func(struct adapter *adapt,
|
||||
enum hal_intf_ps_func efunc_id, u8 *val)
|
||||
enum hal_intf_ps_func efunc_id, u8 *val)
|
||||
{
|
||||
if (adapt->HalFunc.interface_ps_func)
|
||||
return adapt->HalFunc.interface_ps_func(adapt, efunc_id,
|
||||
|
|
|
@ -27,7 +27,6 @@ static s32 translate2dbm(u8 signal_strength_idx)
|
|||
{
|
||||
s32 signal_power; /* in dBm. */
|
||||
|
||||
|
||||
/* Translate to dBm (x=0.5y-95). */
|
||||
signal_power = (s32)((signal_strength_idx + 1) >> 1);
|
||||
signal_power -= 95;
|
||||
|
@ -35,37 +34,31 @@ static s32 translate2dbm(u8 signal_strength_idx)
|
|||
return signal_power;
|
||||
}
|
||||
|
||||
|
||||
static void process_rssi(struct adapter *padapter,union recv_frame *prframe)
|
||||
static void process_rssi(struct adapter *padapter, union recv_frame *prframe)
|
||||
{
|
||||
u32 last_rssi, tmp_val;
|
||||
struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
|
||||
struct signal_stat * signal_stat = &padapter->recvpriv.signal_strength_data;
|
||||
struct signal_stat *signal_stat = &padapter->recvpriv.signal_strength_data;
|
||||
|
||||
{
|
||||
|
||||
if (signal_stat->update_req) {
|
||||
signal_stat->total_num = 0;
|
||||
signal_stat->total_val = 0;
|
||||
signal_stat->update_req = 0;
|
||||
}
|
||||
|
||||
signal_stat->total_num++;
|
||||
signal_stat->total_val += pattrib->phy_info.SignalStrength;
|
||||
signal_stat->avg_val = signal_stat->total_val / signal_stat->total_num;
|
||||
if (signal_stat->update_req) {
|
||||
signal_stat->total_num = 0;
|
||||
signal_stat->total_val = 0;
|
||||
signal_stat->update_req = 0;
|
||||
}
|
||||
|
||||
}/* Process_UI_RSSI_8192C */
|
||||
signal_stat->total_num++;
|
||||
signal_stat->total_val += pattrib->phy_info.SignalStrength;
|
||||
signal_stat->avg_val = signal_stat->total_val / signal_stat->total_num;
|
||||
} /* Process_UI_RSSI_8192C */
|
||||
|
||||
static void process_link_qual(struct adapter *padapter,union recv_frame *prframe)
|
||||
static void process_link_qual(struct adapter *padapter, union recv_frame *prframe)
|
||||
{
|
||||
u32 last_evm=0, tmpVal;
|
||||
u32 last_evm = 0, tmpVal;
|
||||
struct rx_pkt_attrib *pattrib;
|
||||
struct signal_stat * signal_stat;
|
||||
struct signal_stat *signal_stat;
|
||||
|
||||
if (prframe == NULL || padapter==NULL){
|
||||
if (prframe == NULL || padapter == NULL)
|
||||
return;
|
||||
}
|
||||
|
||||
pattrib = &prframe->u.hdr.attrib;
|
||||
signal_stat = &padapter->recvpriv.signal_qual_data;
|
||||
|
@ -85,23 +78,13 @@ void rtl8188e_process_phy_info(struct adapter *padapter, void *prframe)
|
|||
{
|
||||
union recv_frame *precvframe = (union recv_frame *)prframe;
|
||||
|
||||
/* */
|
||||
/* Check RSSI */
|
||||
/* */
|
||||
process_rssi(padapter, precvframe);
|
||||
/* */
|
||||
/* Check PWDB. */
|
||||
/* */
|
||||
|
||||
/* Check EVM */
|
||||
process_link_qual(padapter, precvframe);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void update_recvframe_attrib_88e(
|
||||
union recv_frame *precvframe,
|
||||
struct recv_stat *prxstat)
|
||||
void update_recvframe_attrib_88e(union recv_frame *precvframe, struct recv_stat *prxstat)
|
||||
{
|
||||
struct rx_pkt_attrib *pattrib;
|
||||
struct recv_stat report;
|
||||
|
@ -127,7 +110,7 @@ void update_recvframe_attrib_88e(
|
|||
|
||||
pattrib->physt = (u8)((le32_to_cpu(report.rxdw0) >> 26) & 0x1);/* u8)prxreport->physt; */
|
||||
|
||||
pattrib->bdecrypted = (le32_to_cpu(report.rxdw0) & BIT(27))? 0:1;/* u8)(prxreport->swdec ? 0 : 1); */
|
||||
pattrib->bdecrypted = (le32_to_cpu(report.rxdw0) & BIT(27)) ? 0 : 1;/* u8)(prxreport->swdec ? 0 : 1); */
|
||||
pattrib->encrypt = (u8)((le32_to_cpu(report.rxdw0) >> 20) & 0x7);/* u8)prxreport->security; */
|
||||
|
||||
pattrib->qos = (u8)((le32_to_cpu(report.rxdw0) >> 23) & 0x1);/* u8)prxreport->qos; */
|
||||
|
@ -145,12 +128,11 @@ void update_recvframe_attrib_88e(
|
|||
|
||||
pattrib->icv_err = (u8)((le32_to_cpu(report.rxdw0) >> 15) & 0x1);/* u8)prxreport->icverr; */
|
||||
pattrib->shift_sz = (u8)((le32_to_cpu(report.rxdw0) >> 24) & 0x3);
|
||||
|
||||
} else if (pattrib->pkt_rpt_type == TX_REPORT1) { /* CCX */
|
||||
pattrib->pkt_len = TX_RPT1_PKT_LEN;
|
||||
pattrib->drvinfo_sz = 0;
|
||||
} else if (pattrib->pkt_rpt_type == TX_REPORT2) { /* TX RPT */
|
||||
pattrib->pkt_len =(u16)(le32_to_cpu(report.rxdw0) & 0x3FF);/* Rx length[9:0] */
|
||||
pattrib->pkt_len = (u16)(le32_to_cpu(report.rxdw0) & 0x3FF);/* Rx length[9:0] */
|
||||
pattrib->drvinfo_sz = 0;
|
||||
|
||||
/* */
|
||||
|
@ -160,9 +142,8 @@ void update_recvframe_attrib_88e(
|
|||
pattrib->MacIDValidEntry[1] = le32_to_cpu(report.rxdw5);
|
||||
|
||||
} else if (pattrib->pkt_rpt_type == HIS_REPORT) { /* USB HISR RPT */
|
||||
pattrib->pkt_len = (u16)(le32_to_cpu(report.rxdw0) &0x00003fff);/* u16)prxreport->pktlen; */
|
||||
pattrib->pkt_len = (u16)(le32_to_cpu(report.rxdw0) & 0x00003fff);/* u16)prxreport->pktlen; */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -170,21 +151,19 @@ void update_recvframe_attrib_88e(
|
|||
* Before calling this function,
|
||||
* precvframe->u.hdr.rx_data should be ready!
|
||||
*/
|
||||
void update_recvframe_phyinfo_88e(
|
||||
union recv_frame *precvframe,
|
||||
struct phy_stat *pphy_status)
|
||||
void update_recvframe_phyinfo_88e(union recv_frame *precvframe, struct phy_stat *pphy_status)
|
||||
{
|
||||
struct adapter *padapter = precvframe->u.hdr.adapter;
|
||||
struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
|
||||
struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
|
||||
struct odm_phy_status_info *pPHYInfo = (struct odm_phy_status_info *)(&pattrib->phy_info);
|
||||
u8 *wlanhdr;
|
||||
u8 *wlanhdr;
|
||||
struct odm_per_pkt_info pkt_info;
|
||||
u8 *sa;
|
||||
struct sta_priv *pstapriv;
|
||||
struct sta_info *psta;
|
||||
|
||||
pkt_info.bPacketMatchBSSID =false;
|
||||
pkt_info.bPacketMatchBSSID = false;
|
||||
pkt_info.bPacketToSelf = false;
|
||||
pkt_info.bPacketBeacon = false;
|
||||
|
||||
|
@ -192,19 +171,21 @@ void update_recvframe_phyinfo_88e(
|
|||
|
||||
pkt_info.bPacketMatchBSSID = ((!IsFrameTypeCtrl(wlanhdr)) &&
|
||||
!pattrib->icv_err && !pattrib->crc_err &&
|
||||
_rtw_memcmp(get_hdr_bssid(wlanhdr), get_bssid(&padapter->mlmepriv), ETH_ALEN));
|
||||
_rtw_memcmp(get_hdr_bssid(wlanhdr),
|
||||
get_bssid(&padapter->mlmepriv), ETH_ALEN));
|
||||
|
||||
pkt_info.bPacketToSelf = pkt_info.bPacketMatchBSSID && (_rtw_memcmp(get_da(wlanhdr), myid(&padapter->eeprompriv), ETH_ALEN));
|
||||
pkt_info.bPacketToSelf = pkt_info.bPacketMatchBSSID &&
|
||||
(_rtw_memcmp(get_da(wlanhdr),
|
||||
myid(&padapter->eeprompriv), ETH_ALEN));
|
||||
|
||||
pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID && (GetFrameSubType(wlanhdr) == WIFI_BEACON);
|
||||
pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID &&
|
||||
(GetFrameSubType(wlanhdr) == WIFI_BEACON);
|
||||
|
||||
if (pkt_info.bPacketBeacon){
|
||||
if (check_fwstate(&padapter->mlmepriv, WIFI_STATION_STATE) == true){
|
||||
if (pkt_info.bPacketBeacon) {
|
||||
if (check_fwstate(&padapter->mlmepriv, WIFI_STATION_STATE))
|
||||
sa = padapter->mlmepriv.cur_network.network.MacAddress;
|
||||
}
|
||||
/* to do Ad-hoc */
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
sa = get_sa(wlanhdr);
|
||||
}
|
||||
|
||||
|
@ -215,27 +196,19 @@ void update_recvframe_phyinfo_88e(
|
|||
pkt_info.StationID = psta->mac_id;
|
||||
pkt_info.Rate = pattrib->mcs_rate;
|
||||
|
||||
ODM_PhyStatusQuery(&pHalData->odmpriv,pPHYInfo,(u8 *)pphy_status,&(pkt_info));
|
||||
ODM_PhyStatusQuery(&pHalData->odmpriv, pPHYInfo, (u8 *)pphy_status, &(pkt_info));
|
||||
|
||||
precvframe->u.hdr.psta = NULL;
|
||||
if (pkt_info.bPacketMatchBSSID &&
|
||||
(check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == true))
|
||||
{
|
||||
if (psta)
|
||||
{
|
||||
(check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE))) {
|
||||
if (psta) {
|
||||
precvframe->u.hdr.psta = psta;
|
||||
rtl8188e_process_phy_info(padapter, precvframe);
|
||||
|
||||
}
|
||||
}
|
||||
else if (pkt_info.bPacketToSelf || pkt_info.bPacketBeacon)
|
||||
{
|
||||
if (check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE) == true)
|
||||
{
|
||||
} else if (pkt_info.bPacketToSelf || pkt_info.bPacketBeacon) {
|
||||
if (check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE)) {
|
||||
if (psta)
|
||||
{
|
||||
precvframe->u.hdr.psta = psta;
|
||||
}
|
||||
}
|
||||
rtl8188e_process_phy_info(padapter, precvframe);
|
||||
}
|
||||
|
|
|
@ -22,45 +22,38 @@
|
|||
#include <rtl8188e_sreset.h>
|
||||
#include <rtl8188e_hal.h>
|
||||
|
||||
extern void rtw_cancel_all_timer(struct adapter *padapter);
|
||||
static void _restore_security_setting(struct adapter *padapter)
|
||||
{
|
||||
u8 EntryId = 0;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct sta_priv * pstapriv = &padapter->stapriv;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta;
|
||||
struct security_priv* psecuritypriv=&(padapter->securitypriv);
|
||||
struct security_priv *psecuritypriv = &(padapter->securitypriv);
|
||||
struct mlme_ext_info *pmlmeinfo = &padapter->mlmeextpriv.mlmext_info;
|
||||
|
||||
(pmlmeinfo->auth_algo == dot11AuthAlgrthm_8021X)
|
||||
? rtw_write8(padapter, REG_SECCFG, 0xcc)
|
||||
: rtw_write8(padapter, REG_SECCFG, 0xcf);
|
||||
(pmlmeinfo->auth_algo == dot11AuthAlgrthm_8021X) ?
|
||||
rtw_write8(padapter, REG_SECCFG, 0xcc) :
|
||||
rtw_write8(padapter, REG_SECCFG, 0xcf);
|
||||
|
||||
if ( ( padapter->securitypriv.dot11PrivacyAlgrthm == _WEP40_ ) ||
|
||||
( padapter->securitypriv.dot11PrivacyAlgrthm == _WEP104_ ))
|
||||
{
|
||||
|
||||
for (EntryId=0; EntryId<4; EntryId++)
|
||||
{
|
||||
if ((padapter->securitypriv.dot11PrivacyAlgrthm == _WEP40_) ||
|
||||
(padapter->securitypriv.dot11PrivacyAlgrthm == _WEP104_)) {
|
||||
for (EntryId = 0; EntryId < 4; EntryId++) {
|
||||
if (EntryId == psecuritypriv->dot11PrivacyKeyIndex)
|
||||
rtw_set_key(padapter,&padapter->securitypriv, EntryId, 1);
|
||||
rtw_set_key(padapter, &padapter->securitypriv, EntryId, 1);
|
||||
else
|
||||
rtw_set_key(padapter,&padapter->securitypriv, EntryId, 0);
|
||||
rtw_set_key(padapter, &padapter->securitypriv, EntryId, 0);
|
||||
}
|
||||
|
||||
}
|
||||
else if ((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||
|
||||
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_))
|
||||
{
|
||||
} else if ((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||
|
||||
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)) {
|
||||
psta = rtw_get_stainfo(pstapriv, get_bssid(pmlmepriv));
|
||||
if (psta) {
|
||||
/* pairwise key */
|
||||
rtw_setstakey_cmd(padapter, (unsigned char *)psta, true);
|
||||
/* group key */
|
||||
rtw_set_key(padapter,&padapter->securitypriv,padapter->securitypriv.dot118021XGrpKeyid, 0);
|
||||
rtw_set_key(padapter, &padapter->securitypriv, padapter->securitypriv.dot118021XGrpKeyid, 0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void _restore_network_status(struct adapter *padapter)
|
||||
|
@ -68,7 +61,7 @@ static void _restore_network_status(struct adapter *padapter)
|
|||
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct wlan_bssid_ex *pnetwork = (struct wlan_bssid_ex*)(&(pmlmeinfo->network));
|
||||
struct wlan_bssid_ex *pnetwork = (struct wlan_bssid_ex *)(&(pmlmeinfo->network));
|
||||
unsigned short caps;
|
||||
u8 join_type;
|
||||
|
||||
|
@ -78,7 +71,7 @@ static void _restore_network_status(struct adapter *padapter)
|
|||
/* set MSR to nolink */
|
||||
Set_MSR(padapter, _HW_STATE_NOLINK_);
|
||||
/* reject all data frame */
|
||||
rtw_write16(padapter, REG_RXFLTMAP2,0x00);
|
||||
rtw_write16(padapter, REG_RXFLTMAP2, 0x00);
|
||||
/* reset TSF */
|
||||
rtw_write8(padapter, REG_DUAL_TSF_RST, (BIT(0)|BIT(1)));
|
||||
|
||||
|
@ -114,7 +107,7 @@ static void _restore_network_status(struct adapter *padapter)
|
|||
|
||||
mlmeext_joinbss_event_callback(padapter, 1);
|
||||
/* restore Sequence No. */
|
||||
rtw_write8(padapter,0x4dc,padapter->xmitpriv.nqos_ssn);
|
||||
rtw_write8(padapter, 0x4dc, padapter->xmitpriv.nqos_ssn);
|
||||
}
|
||||
|
||||
void rtl8188e_silentreset_for_specific_platform(struct adapter *padapter)
|
||||
|
@ -131,24 +124,23 @@ void rtl8188e_sreset_xmit_status_check(struct adapter *padapter)
|
|||
unsigned int diff_time;
|
||||
u32 txdma_status;
|
||||
|
||||
if ( (txdma_status=rtw_read32(padapter, REG_TXDMA_STATUS)) !=0x00){
|
||||
txdma_status = rtw_read32(padapter, REG_TXDMA_STATUS);
|
||||
if (txdma_status != 0x00) {
|
||||
DBG_88E("%s REG_TXDMA_STATUS:0x%08x\n", __func__, txdma_status);
|
||||
rtw_write32(padapter,REG_TXDMA_STATUS,txdma_status);
|
||||
rtw_write32(padapter, REG_TXDMA_STATUS, txdma_status);
|
||||
rtl8188e_silentreset_for_specific_platform(padapter);
|
||||
}
|
||||
/* total xmit irp = 4 */
|
||||
current_time = rtw_get_current_time();
|
||||
if (0==pxmitpriv->free_xmitbuf_cnt)
|
||||
{
|
||||
if (0 == pxmitpriv->free_xmitbuf_cnt) {
|
||||
diff_time = jiffies_to_msecs(current_time - psrtpriv->last_tx_time);
|
||||
|
||||
if (diff_time > 2000){
|
||||
if (psrtpriv->last_tx_complete_time==0){
|
||||
if (diff_time > 2000) {
|
||||
if (psrtpriv->last_tx_complete_time == 0) {
|
||||
psrtpriv->last_tx_complete_time = current_time;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
diff_time = jiffies_to_msecs(current_time - psrtpriv->last_tx_complete_time);
|
||||
if (diff_time > 4000){
|
||||
if (diff_time > 4000) {
|
||||
DBG_88E("%s tx hang\n", __func__);
|
||||
rtl8188e_silentreset_for_specific_platform(padapter);
|
||||
}
|
||||
|
@ -160,18 +152,17 @@ void rtl8188e_sreset_xmit_status_check(struct adapter *padapter)
|
|||
void rtl8188e_sreset_linked_status_check(struct adapter *padapter)
|
||||
{
|
||||
u32 rx_dma_status = 0;
|
||||
u8 fw_status=0;
|
||||
rx_dma_status = rtw_read32(padapter,REG_RXDMA_STATUS);
|
||||
if (rx_dma_status!= 0x00){
|
||||
DBG_88E("%s REG_RXDMA_STATUS:0x%08x\n",__func__,rx_dma_status);
|
||||
rtw_write32(padapter,REG_RXDMA_STATUS,rx_dma_status);
|
||||
u8 fw_status = 0;
|
||||
rx_dma_status = rtw_read32(padapter, REG_RXDMA_STATUS);
|
||||
if (rx_dma_status != 0x00) {
|
||||
DBG_88E("%s REG_RXDMA_STATUS:0x%08x\n", __func__, rx_dma_status);
|
||||
rtw_write32(padapter, REG_RXDMA_STATUS, rx_dma_status);
|
||||
}
|
||||
fw_status = rtw_read8(padapter,REG_FMETHR);
|
||||
if (fw_status != 0x00)
|
||||
{
|
||||
fw_status = rtw_read8(padapter, REG_FMETHR);
|
||||
if (fw_status != 0x00) {
|
||||
if (fw_status == 1)
|
||||
DBG_88E("%s REG_FW_STATUS (0x%02x), Read_Efuse_Fail !! \n",__func__,fw_status);
|
||||
DBG_88E("%s REG_FW_STATUS (0x%02x), Read_Efuse_Fail !!\n", __func__, fw_status);
|
||||
else if (fw_status == 2)
|
||||
DBG_88E("%s REG_FW_STATUS (0x%02x), Condition_No_Match !! \n",__func__,fw_status);
|
||||
DBG_88E("%s REG_FW_STATUS (0x%02x), Condition_No_Match !!\n", __func__, fw_status);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,14 +33,15 @@ void dump_txrpt_ccx_88e(void *buf)
|
|||
"retry_cnt:%u, lifetime_over:%u, retry_over:%u\n"
|
||||
"ccx_qtime:%u\n"
|
||||
"final_data_rate:0x%02x\n"
|
||||
"qsel:%u, sw:0x%03x\n"
|
||||
, __func__
|
||||
, txrpt_ccx->tag1, txrpt_ccx->pkt_num, txrpt_ccx->txdma_underflow, txrpt_ccx->int_bt, txrpt_ccx->int_tri, txrpt_ccx->int_ccx
|
||||
, txrpt_ccx->mac_id, txrpt_ccx->pkt_ok, txrpt_ccx->bmc
|
||||
, txrpt_ccx->retry_cnt, txrpt_ccx->lifetime_over, txrpt_ccx->retry_over
|
||||
, txrpt_ccx_qtime_88e(txrpt_ccx)
|
||||
, txrpt_ccx->final_data_rate
|
||||
, txrpt_ccx->qsel, txrpt_ccx_sw_88e(txrpt_ccx)
|
||||
"qsel:%u, sw:0x%03x\n",
|
||||
__func__, txrpt_ccx->tag1, txrpt_ccx->pkt_num,
|
||||
txrpt_ccx->txdma_underflow, txrpt_ccx->int_bt,
|
||||
txrpt_ccx->int_tri, txrpt_ccx->int_ccx,
|
||||
txrpt_ccx->mac_id, txrpt_ccx->pkt_ok, txrpt_ccx->bmc,
|
||||
txrpt_ccx->retry_cnt, txrpt_ccx->lifetime_over,
|
||||
txrpt_ccx->retry_over, txrpt_ccx_qtime_88e(txrpt_ccx),
|
||||
txrpt_ccx->final_data_rate, txrpt_ccx->qsel,
|
||||
txrpt_ccx_sw_88e(txrpt_ccx)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -50,44 +51,41 @@ void handle_txrpt_ccx_88e(struct adapter *adapter, u8 *buf)
|
|||
|
||||
if (txrpt_ccx->int_ccx) {
|
||||
if (txrpt_ccx->pkt_ok)
|
||||
rtw_ack_tx_done(&adapter->xmitpriv, RTW_SCTX_DONE_SUCCESS);
|
||||
rtw_ack_tx_done(&adapter->xmitpriv,
|
||||
RTW_SCTX_DONE_SUCCESS);
|
||||
else
|
||||
rtw_ack_tx_done(&adapter->xmitpriv, RTW_SCTX_DONE_CCX_PKT_FAIL);
|
||||
rtw_ack_tx_done(&adapter->xmitpriv,
|
||||
RTW_SCTX_DONE_CCX_PKT_FAIL);
|
||||
}
|
||||
}
|
||||
|
||||
void _dbg_dump_tx_info(struct adapter *padapter,int frame_tag,struct tx_desc *ptxdesc)
|
||||
void _dbg_dump_tx_info(struct adapter *padapter, int frame_tag,
|
||||
struct tx_desc *ptxdesc)
|
||||
{
|
||||
u8 bDumpTxPkt;
|
||||
u8 bDumpTxDesc = false;
|
||||
rtw_hal_get_def_var(padapter, HAL_DEF_DBG_DUMP_TXPKT, &(bDumpTxPkt));
|
||||
u8 dmp_txpkt;
|
||||
bool dump_txdesc = false;
|
||||
rtw_hal_get_def_var(padapter, HAL_DEF_DBG_DUMP_TXPKT, &(dmp_txpkt));
|
||||
|
||||
if (bDumpTxPkt ==1){/* dump txdesc for data frame */
|
||||
if (dmp_txpkt == 1) {/* dump txdesc for data frame */
|
||||
DBG_88E("dump tx_desc for data frame\n");
|
||||
if ((frame_tag&0x0f) == DATA_FRAMETAG){
|
||||
bDumpTxDesc = true;
|
||||
}
|
||||
}
|
||||
else if (bDumpTxPkt ==2){/* dump txdesc for mgnt frame */
|
||||
if ((frame_tag & 0x0f) == DATA_FRAMETAG)
|
||||
dump_txdesc = true;
|
||||
} else if (dmp_txpkt == 2) {/* dump txdesc for mgnt frame */
|
||||
DBG_88E("dump tx_desc for mgnt frame\n");
|
||||
if ((frame_tag&0x0f) == MGNT_FRAMETAG){
|
||||
bDumpTxDesc = true;
|
||||
}
|
||||
}
|
||||
else if (bDumpTxPkt ==3){/* dump early info */
|
||||
if ((frame_tag & 0x0f) == MGNT_FRAMETAG)
|
||||
dump_txdesc = true;
|
||||
}
|
||||
|
||||
if (bDumpTxDesc){
|
||||
if (dump_txdesc) {
|
||||
DBG_88E("=====================================\n");
|
||||
DBG_88E("txdw0(0x%08x)\n",ptxdesc->txdw0);
|
||||
DBG_88E("txdw1(0x%08x)\n",ptxdesc->txdw1);
|
||||
DBG_88E("txdw2(0x%08x)\n",ptxdesc->txdw2);
|
||||
DBG_88E("txdw3(0x%08x)\n",ptxdesc->txdw3);
|
||||
DBG_88E("txdw4(0x%08x)\n",ptxdesc->txdw4);
|
||||
DBG_88E("txdw5(0x%08x)\n",ptxdesc->txdw5);
|
||||
DBG_88E("txdw6(0x%08x)\n",ptxdesc->txdw6);
|
||||
DBG_88E("txdw7(0x%08x)\n",ptxdesc->txdw7);
|
||||
DBG_88E("txdw0(0x%08x)\n", ptxdesc->txdw0);
|
||||
DBG_88E("txdw1(0x%08x)\n", ptxdesc->txdw1);
|
||||
DBG_88E("txdw2(0x%08x)\n", ptxdesc->txdw2);
|
||||
DBG_88E("txdw3(0x%08x)\n", ptxdesc->txdw3);
|
||||
DBG_88E("txdw4(0x%08x)\n", ptxdesc->txdw4);
|
||||
DBG_88E("txdw5(0x%08x)\n", ptxdesc->txdw5);
|
||||
DBG_88E("txdw6(0x%08x)\n", ptxdesc->txdw6);
|
||||
DBG_88E("txdw7(0x%08x)\n", ptxdesc->txdw7);
|
||||
DBG_88E("=====================================\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,114 +24,72 @@
|
|||
#include <rtl8188e_led.h>
|
||||
|
||||
/* LED object. */
|
||||
/* */
|
||||
|
||||
|
||||
/* */
|
||||
/* Prototype of protected function. */
|
||||
/* */
|
||||
|
||||
|
||||
/* */
|
||||
/* LED_819xUsb routines. */
|
||||
/* */
|
||||
|
||||
/* */
|
||||
/* Description: */
|
||||
/* Turn on LED according to LedPin specified. */
|
||||
/* */
|
||||
void SwLedOn(struct adapter *padapter, struct LED_871x * pLed)
|
||||
/* Description: */
|
||||
/* Turn on LED according to LedPin specified. */
|
||||
void SwLedOn(struct adapter *padapter, struct LED_871x *pLed)
|
||||
{
|
||||
u8 LedCfg;
|
||||
|
||||
if ( (padapter->bSurpriseRemoved == true) || ( padapter->bDriverStopped == true))
|
||||
{
|
||||
if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
|
||||
return;
|
||||
}
|
||||
|
||||
LedCfg = rtw_read8(padapter, REG_LEDCFG2);
|
||||
switch (pLed->LedPin)
|
||||
{
|
||||
case LED_PIN_LED0:
|
||||
rtw_write8(padapter, REG_LEDCFG2, (LedCfg&0xf0)|BIT5|BIT6); /* SW control led0 on. */
|
||||
break;
|
||||
|
||||
case LED_PIN_LED1:
|
||||
rtw_write8(padapter, REG_LEDCFG2, (LedCfg&0x0f)|BIT5); /* SW control led1 on. */
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
switch (pLed->LedPin) {
|
||||
case LED_PIN_LED0:
|
||||
rtw_write8(padapter, REG_LEDCFG2, (LedCfg&0xf0)|BIT5|BIT6); /* SW control led0 on. */
|
||||
break;
|
||||
case LED_PIN_LED1:
|
||||
rtw_write8(padapter, REG_LEDCFG2, (LedCfg&0x0f)|BIT5); /* SW control led1 on. */
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
pLed->bLedOn = true;
|
||||
}
|
||||
|
||||
|
||||
/* */
|
||||
/* Description: */
|
||||
/* Turn off LED according to LedPin specified. */
|
||||
/* */
|
||||
void SwLedOff(struct adapter *padapter, struct LED_871x * pLed)
|
||||
/* Description: */
|
||||
/* Turn off LED according to LedPin specified. */
|
||||
void SwLedOff(struct adapter *padapter, struct LED_871x *pLed)
|
||||
{
|
||||
u8 LedCfg;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
|
||||
|
||||
if ((padapter->bSurpriseRemoved == true) || ( padapter->bDriverStopped == true))
|
||||
{
|
||||
if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
||||
LedCfg = rtw_read8(padapter, REG_LEDCFG2);/* 0x4E */
|
||||
|
||||
switch (pLed->LedPin)
|
||||
{
|
||||
case LED_PIN_LED0:
|
||||
if (pHalData->bLedOpenDrain == true) /* Open-drain arrangement for controlling the LED) */
|
||||
{
|
||||
LedCfg &= 0x90; /* Set to software control. */
|
||||
rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3));
|
||||
LedCfg = rtw_read8(padapter, REG_MAC_PINMUX_CFG);
|
||||
LedCfg &= 0xFE;
|
||||
rtw_write8(padapter, REG_MAC_PINMUX_CFG, LedCfg);
|
||||
}
|
||||
else
|
||||
{
|
||||
rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3|BIT5|BIT6));
|
||||
}
|
||||
break;
|
||||
|
||||
case LED_PIN_LED1:
|
||||
LedCfg &= 0x0f; /* Set to software control. */
|
||||
switch (pLed->LedPin) {
|
||||
case LED_PIN_LED0:
|
||||
if (pHalData->bLedOpenDrain) {
|
||||
/* Open-drain arrangement for controlling the LED) */
|
||||
LedCfg &= 0x90; /* Set to software control. */
|
||||
rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3));
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
LedCfg = rtw_read8(padapter, REG_MAC_PINMUX_CFG);
|
||||
LedCfg &= 0xFE;
|
||||
rtw_write8(padapter, REG_MAC_PINMUX_CFG, LedCfg);
|
||||
} else {
|
||||
rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3|BIT5|BIT6));
|
||||
}
|
||||
break;
|
||||
case LED_PIN_LED1:
|
||||
LedCfg &= 0x0f; /* Set to software control. */
|
||||
rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
exit:
|
||||
pLed->bLedOn = false;
|
||||
|
||||
}
|
||||
|
||||
/* */
|
||||
/* Interface to manipulate LED objects. */
|
||||
/* */
|
||||
|
||||
|
||||
/* */
|
||||
/* Default LED behavior. */
|
||||
/* */
|
||||
|
||||
/* */
|
||||
/* Description: */
|
||||
/* Initialize all LED_871x objects. */
|
||||
/* */
|
||||
void
|
||||
rtl8188eu_InitSwLeds(
|
||||
struct adapter *padapter
|
||||
)
|
||||
/* Description: */
|
||||
/* Initialize all LED_871x objects. */
|
||||
void rtl8188eu_InitSwLeds(struct adapter *padapter)
|
||||
{
|
||||
struct led_priv *pledpriv = &(padapter->ledpriv);
|
||||
|
||||
|
@ -139,21 +97,15 @@ rtl8188eu_InitSwLeds(
|
|||
|
||||
InitLed871x(padapter, &(pledpriv->SwLed0), LED_PIN_LED0);
|
||||
|
||||
InitLed871x(padapter,&(pledpriv->SwLed1), LED_PIN_LED1);
|
||||
InitLed871x(padapter, &(pledpriv->SwLed1), LED_PIN_LED1);
|
||||
}
|
||||
|
||||
|
||||
/* */
|
||||
/* Description: */
|
||||
/* DeInitialize all LED_819xUsb objects. */
|
||||
/* */
|
||||
void
|
||||
rtl8188eu_DeInitSwLeds(
|
||||
struct adapter *padapter
|
||||
)
|
||||
/* Description: */
|
||||
/* DeInitialize all LED_819xUsb objects. */
|
||||
void rtl8188eu_DeInitSwLeds(struct adapter *padapter)
|
||||
{
|
||||
struct led_priv *ledpriv = &(padapter->ledpriv);
|
||||
|
||||
DeInitLed871x( &(ledpriv->SwLed0) );
|
||||
DeInitLed871x( &(ledpriv->SwLed1) );
|
||||
DeInitLed871x(&(ledpriv->SwLed0));
|
||||
DeInitLed871x(&(ledpriv->SwLed1));
|
||||
}
|
||||
|
|
|
@ -32,22 +32,20 @@
|
|||
|
||||
#include <rtl8188e_hal.h>
|
||||
|
||||
|
||||
void rtl8188eu_init_recvbuf(struct adapter *padapter, struct recv_buf *precvbuf)
|
||||
{
|
||||
|
||||
precvbuf->transfer_len = 0;
|
||||
|
||||
precvbuf->len = 0;
|
||||
|
||||
precvbuf->ref_cnt = 0;
|
||||
|
||||
if (precvbuf->pbuf)
|
||||
{
|
||||
precvbuf->pdata = precvbuf->phead = precvbuf->ptail = precvbuf->pbuf;
|
||||
if (precvbuf->pbuf) {
|
||||
precvbuf->pdata = precvbuf->pbuf;
|
||||
precvbuf->phead = precvbuf->pbuf;
|
||||
precvbuf->ptail = precvbuf->pbuf;
|
||||
precvbuf->pend = precvbuf->pdata + MAX_RECVBUF_SZ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int rtl8188eu_init_recv_priv(struct adapter *padapter)
|
||||
|
@ -57,88 +55,68 @@ int rtl8188eu_init_recv_priv(struct adapter *padapter)
|
|||
struct recv_buf *precvbuf;
|
||||
|
||||
tasklet_init(&precvpriv->recv_tasklet,
|
||||
(void(*)(unsigned long))rtl8188eu_recv_tasklet,
|
||||
(unsigned long)padapter);
|
||||
(void(*)(unsigned long))rtl8188eu_recv_tasklet,
|
||||
(unsigned long)padapter);
|
||||
|
||||
/* init recv_buf */
|
||||
_rtw_init_queue(&precvpriv->free_recv_buf_queue);
|
||||
|
||||
precvpriv->pallocated_recv_buf = rtw_zmalloc(NR_RECVBUFF *sizeof(struct recv_buf) + 4);
|
||||
if (precvpriv->pallocated_recv_buf==NULL){
|
||||
res= _FAIL;
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("alloc recv_buf fail!\n"));
|
||||
precvpriv->pallocated_recv_buf = rtw_zmalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4);
|
||||
if (precvpriv->pallocated_recv_buf == NULL) {
|
||||
res = _FAIL;
|
||||
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("alloc recv_buf fail!\n"));
|
||||
goto exit;
|
||||
}
|
||||
_rtw_memset(precvpriv->pallocated_recv_buf, 0, NR_RECVBUFF *sizeof(struct recv_buf) + 4);
|
||||
_rtw_memset(precvpriv->pallocated_recv_buf, 0, NR_RECVBUFF * sizeof(struct recv_buf) + 4);
|
||||
|
||||
precvpriv->precv_buf = (u8 *)N_BYTE_ALIGMENT((size_t)(precvpriv->pallocated_recv_buf), 4);
|
||||
|
||||
|
||||
precvbuf = (struct recv_buf*)precvpriv->precv_buf;
|
||||
precvbuf = (struct recv_buf *)precvpriv->precv_buf;
|
||||
|
||||
for (i=0; i < NR_RECVBUFF ; i++)
|
||||
{
|
||||
for (i = 0; i < NR_RECVBUFF; i++) {
|
||||
_rtw_init_listhead(&precvbuf->list);
|
||||
|
||||
_rtw_spinlock_init(&precvbuf->recvbuf_lock);
|
||||
|
||||
precvbuf->alloc_sz = MAX_RECVBUF_SZ;
|
||||
|
||||
res = rtw_os_recvbuf_resource_alloc(padapter, precvbuf);
|
||||
if (res==_FAIL)
|
||||
if (res == _FAIL)
|
||||
break;
|
||||
|
||||
precvbuf->ref_cnt = 0;
|
||||
precvbuf->adapter =padapter;
|
||||
|
||||
|
||||
|
||||
precvbuf->adapter = padapter;
|
||||
precvbuf++;
|
||||
|
||||
}
|
||||
precvpriv->free_recv_buf_queue_cnt = NR_RECVBUFF;
|
||||
skb_queue_head_init(&precvpriv->rx_skb_queue);
|
||||
|
||||
{
|
||||
int i;
|
||||
size_t tmpaddr=0;
|
||||
size_t alignment=0;
|
||||
struct sk_buff *pskb=NULL;
|
||||
size_t tmpaddr = 0;
|
||||
size_t alignment = 0;
|
||||
struct sk_buff *pskb = NULL;
|
||||
|
||||
skb_queue_head_init(&precvpriv->free_recv_skb_queue);
|
||||
|
||||
for (i=0; i<NR_PREALLOC_RECV_SKB; i++)
|
||||
{
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)) /* www.mail-archive.com/netdev@vger.kernel.org/msg17214.html */
|
||||
for (i = 0; i < NR_PREALLOC_RECV_SKB; i++) {
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18))
|
||||
pskb = __dev_alloc_skb(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ, GFP_KERNEL);
|
||||
#else
|
||||
#else
|
||||
pskb = __netdev_alloc_skb(padapter->pnetdev, MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ, GFP_KERNEL);
|
||||
#endif
|
||||
|
||||
if (pskb)
|
||||
{
|
||||
#endif
|
||||
if (pskb) {
|
||||
pskb->dev = padapter->pnetdev;
|
||||
|
||||
tmpaddr = (size_t)pskb->data;
|
||||
alignment = tmpaddr & (RECVBUFF_ALIGN_SZ-1);
|
||||
skb_reserve(pskb, (RECVBUFF_ALIGN_SZ - alignment));
|
||||
|
||||
skb_queue_tail(&precvpriv->free_recv_skb_queue, pskb);
|
||||
}
|
||||
|
||||
pskb=NULL;
|
||||
|
||||
pskb = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
void rtl8188eu_free_recv_priv (struct adapter *padapter)
|
||||
void rtl8188eu_free_recv_priv(struct adapter *padapter)
|
||||
{
|
||||
int i;
|
||||
struct recv_buf *precvbuf;
|
||||
|
@ -146,14 +124,13 @@ void rtl8188eu_free_recv_priv (struct adapter *padapter)
|
|||
|
||||
precvbuf = (struct recv_buf *)precvpriv->precv_buf;
|
||||
|
||||
for (i=0; i < NR_RECVBUFF ; i++)
|
||||
{
|
||||
for (i = 0; i < NR_RECVBUFF; i++) {
|
||||
rtw_os_recvbuf_resource_free(padapter, precvbuf);
|
||||
precvbuf++;
|
||||
}
|
||||
|
||||
if (precvpriv->pallocated_recv_buf)
|
||||
rtw_mfree(precvpriv->pallocated_recv_buf, NR_RECVBUFF *sizeof(struct recv_buf) + 4);
|
||||
rtw_mfree(precvpriv->pallocated_recv_buf, NR_RECVBUFF * sizeof(struct recv_buf) + 4);
|
||||
|
||||
if (skb_queue_len(&precvpriv->rx_skb_queue))
|
||||
DBG_88E(KERN_WARNING "rx_skb_queue not empty\n");
|
||||
|
|
|
@ -26,65 +26,58 @@
|
|||
#include <usb_ops.h>
|
||||
#include <rtl8188e_hal.h>
|
||||
|
||||
s32 rtl8188eu_init_xmit_priv(struct adapter *padapter)
|
||||
s32 rtl8188eu_init_xmit_priv(struct adapter *adapt)
|
||||
{
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
|
||||
struct xmit_priv *pxmitpriv = &adapt->xmitpriv;
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
|
||||
tasklet_init(&pxmitpriv->xmit_tasklet,
|
||||
(void(*)(unsigned long))rtl8188eu_xmit_tasklet,
|
||||
(unsigned long)padapter);
|
||||
(void(*)(unsigned long))rtl8188eu_xmit_tasklet,
|
||||
(unsigned long)adapt);
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
void rtl8188eu_free_xmit_priv(struct adapter *padapter)
|
||||
void rtl8188eu_free_xmit_priv(struct adapter *adapt)
|
||||
{
|
||||
}
|
||||
|
||||
static u8 urb_zero_packet_chk(struct adapter *padapter, int sz)
|
||||
static u8 urb_zero_packet_chk(struct adapter *adapt, int sz)
|
||||
{
|
||||
u8 blnSetTxDescOffset;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
|
||||
blnSetTxDescOffset = (((sz + TXDESC_SIZE) % pHalData->UsbBulkOutSize) ==0)?1:0;
|
||||
u8 set_tx_desc_offset;
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
set_tx_desc_offset = (((sz + TXDESC_SIZE) % haldata->UsbBulkOutSize) == 0) ? 1 : 0;
|
||||
|
||||
return blnSetTxDescOffset;
|
||||
return set_tx_desc_offset;
|
||||
}
|
||||
|
||||
static void rtl8188eu_cal_txdesc_chksum(struct tx_desc *ptxdesc)
|
||||
{
|
||||
u16 *usPtr = (u16*)ptxdesc;
|
||||
u32 count = 16; /* (32 bytes / 2 bytes per XOR) => 16 times */
|
||||
u32 index;
|
||||
u16 checksum = 0;
|
||||
u16 *usptr = (u16 *)ptxdesc;
|
||||
u32 count = 16; /* (32 bytes / 2 bytes per XOR) => 16 times */
|
||||
u32 index;
|
||||
u16 checksum = 0;
|
||||
|
||||
/* Clear first */
|
||||
ptxdesc->txdw7 &= cpu_to_le32(0xffff0000);
|
||||
/* Clear first */
|
||||
ptxdesc->txdw7 &= cpu_to_le32(0xffff0000);
|
||||
|
||||
for (index = 0; index < count; index++)
|
||||
checksum = checksum ^ le16_to_cpu(*(__le16 *)(usPtr + index));
|
||||
ptxdesc->txdw7 |= cpu_to_le32(0x0000ffff&checksum);
|
||||
for (index = 0; index < count; index++)
|
||||
checksum = checksum ^ le16_to_cpu(*(__le16 *)(usptr + index));
|
||||
ptxdesc->txdw7 |= cpu_to_le32(0x0000ffff & checksum);
|
||||
}
|
||||
/* */
|
||||
|
||||
/* Description: In normal chip, we should send some packet to Hw which will be used by Fw */
|
||||
/* in FW LPS mode. The function is to fill the Tx descriptor of this packets, then */
|
||||
/* Fw can tell Hw to send these packet derectly. */
|
||||
/* */
|
||||
void rtl8188e_fill_fake_txdesc(
|
||||
struct adapter * padapter,
|
||||
u8* pDesc,
|
||||
u32 BufferLen,
|
||||
u8 IsPsPoll,
|
||||
u8 IsBTQosNull)
|
||||
/* in FW LPS mode. The function is to fill the Tx descriptor of this packets, then */
|
||||
/* Fw can tell Hw to send these packet derectly. */
|
||||
void rtl8188e_fill_fake_txdesc(struct adapter *adapt, u8 *desc, u32 BufferLen, u8 ispspoll, u8 is_btqosnull)
|
||||
{
|
||||
struct tx_desc *ptxdesc;
|
||||
|
||||
|
||||
/* Clear all status */
|
||||
ptxdesc = (struct tx_desc*)pDesc;
|
||||
_rtw_memset(pDesc, 0, TXDESC_SIZE);
|
||||
ptxdesc = (struct tx_desc *)desc;
|
||||
_rtw_memset(desc, 0, TXDESC_SIZE);
|
||||
|
||||
/* offset 0 */
|
||||
ptxdesc->txdw0 |= cpu_to_le32( OWN | FSG | LSG); /* own, bFirstSeg, bLastSeg; */
|
||||
ptxdesc->txdw0 |= cpu_to_le32(OWN | FSG | LSG); /* own, bFirstSeg, bLastSeg; */
|
||||
|
||||
ptxdesc->txdw0 |= cpu_to_le32(((TXDESC_SIZE+OFFSET_SZ)<<OFFSET_SHT)&0x00ff0000); /* 32 bytes for TX Desc */
|
||||
|
||||
|
@ -94,20 +87,15 @@ void rtl8188e_fill_fake_txdesc(
|
|||
ptxdesc->txdw1 |= cpu_to_le32((QSLT_MGNT<<QSEL_SHT)&0x00001f00); /* Fixed queue of Mgnt queue */
|
||||
|
||||
/* Set NAVUSEHDR to prevent Ps-poll AId filed to be changed to error vlaue by Hw. */
|
||||
if (IsPsPoll)
|
||||
{
|
||||
if (ispspoll) {
|
||||
ptxdesc->txdw1 |= cpu_to_le32(NAVUSEHDR);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
ptxdesc->txdw4 |= cpu_to_le32(BIT(7)); /* Hw set sequence number */
|
||||
ptxdesc->txdw3 |= cpu_to_le32((8 <<28)); /* set bit3 to 1. Suugested by TimChen. 2009.12.29. */
|
||||
ptxdesc->txdw3 |= cpu_to_le32((8 << 28)); /* set bit3 to 1. Suugested by TimChen. 2009.12.29. */
|
||||
}
|
||||
|
||||
if (true == IsBTQosNull)
|
||||
{
|
||||
if (is_btqosnull)
|
||||
ptxdesc->txdw2 |= cpu_to_le32(BIT(23)); /* BT NULL */
|
||||
}
|
||||
|
||||
/* offset 16 */
|
||||
ptxdesc->txdw4 |= cpu_to_le32(BIT(8));/* driver uses rate */
|
||||
|
@ -160,16 +148,16 @@ static void fill_txdesc_vcs(struct pkt_attrib *pattrib, __le32 *pdw)
|
|||
*pdw |= cpu_to_le32(HW_RTS_EN);
|
||||
/* Set RTS BW */
|
||||
if (pattrib->ht_en) {
|
||||
*pdw |= (pattrib->bwmode&HT_CHANNEL_WIDTH_40)? cpu_to_le32(BIT(27)):0;
|
||||
*pdw |= (pattrib->bwmode&HT_CHANNEL_WIDTH_40) ? cpu_to_le32(BIT(27)) : 0;
|
||||
|
||||
if (pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_LOWER)
|
||||
*pdw |= cpu_to_le32((0x01<<28)&0x30000000);
|
||||
*pdw |= cpu_to_le32((0x01 << 28) & 0x30000000);
|
||||
else if (pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_UPPER)
|
||||
*pdw |= cpu_to_le32((0x02<<28)&0x30000000);
|
||||
*pdw |= cpu_to_le32((0x02 << 28) & 0x30000000);
|
||||
else if (pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_DONT_CARE)
|
||||
*pdw |= 0;
|
||||
else
|
||||
*pdw |= cpu_to_le32((0x03<<28)&0x30000000);
|
||||
*pdw |= cpu_to_le32((0x03 << 28) & 0x30000000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -177,40 +165,39 @@ static void fill_txdesc_vcs(struct pkt_attrib *pattrib, __le32 *pdw)
|
|||
static void fill_txdesc_phy(struct pkt_attrib *pattrib, __le32 *pdw)
|
||||
{
|
||||
if (pattrib->ht_en) {
|
||||
*pdw |= (pattrib->bwmode&HT_CHANNEL_WIDTH_40)? cpu_to_le32(BIT(25)):0;
|
||||
*pdw |= (pattrib->bwmode&HT_CHANNEL_WIDTH_40) ? cpu_to_le32(BIT(25)) : 0;
|
||||
|
||||
if (pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_LOWER)
|
||||
*pdw |= cpu_to_le32((0x01<<DATA_SC_SHT)&0x003f0000);
|
||||
*pdw |= cpu_to_le32((0x01 << DATA_SC_SHT) & 0x003f0000);
|
||||
else if (pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_UPPER)
|
||||
*pdw |= cpu_to_le32((0x02<<DATA_SC_SHT)&0x003f0000);
|
||||
*pdw |= cpu_to_le32((0x02 << DATA_SC_SHT) & 0x003f0000);
|
||||
else if (pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_DONT_CARE)
|
||||
*pdw |= 0;
|
||||
else
|
||||
*pdw |= cpu_to_le32((0x03<<DATA_SC_SHT)&0x003f0000);
|
||||
*pdw |= cpu_to_le32((0x03 << DATA_SC_SHT) & 0x003f0000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bagg_pkt)
|
||||
static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bagg_pkt)
|
||||
{
|
||||
int pull=0;
|
||||
int pull = 0;
|
||||
uint qsel;
|
||||
u8 data_rate,pwr_status,offset;
|
||||
struct adapter *padapter = pxmitframe->padapter;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
u8 data_rate, pwr_status, offset;
|
||||
struct adapter *adapt = pxmitframe->padapter;
|
||||
struct mlme_priv *pmlmepriv = &adapt->mlmepriv;
|
||||
struct pkt_attrib *pattrib = &pxmitframe->attrib;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
struct tx_desc *ptxdesc = (struct tx_desc *)pmem;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_priv *pmlmeext = &adapt->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
int bmcst = IS_MCAST(pattrib->ra);
|
||||
|
||||
#ifdef CONFIG_P2P
|
||||
struct wifidirect_info* pwdinfo = &padapter->wdinfo;
|
||||
struct wifidirect_info *pwdinfo = &adapt->wdinfo;
|
||||
#endif /* CONFIG_P2P */
|
||||
|
||||
if (padapter->registrypriv.mp_mode == 0) {
|
||||
if ((!bagg_pkt) &&(urb_zero_packet_chk(padapter, sz)==0))/* sz %512) != 0 */ {
|
||||
if (adapt->registrypriv.mp_mode == 0) {
|
||||
if ((!bagg_pkt) && (urb_zero_packet_chk(adapt, sz) == 0)) {
|
||||
ptxdesc = (struct tx_desc *)(pmem+PACKET_OFFSET_SZ);
|
||||
pull = 1;
|
||||
}
|
||||
|
@ -218,7 +205,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
|
|||
|
||||
_rtw_memset(ptxdesc, 0, sizeof(struct tx_desc));
|
||||
|
||||
/* 4 offset 0 */
|
||||
/* 4 offset 0 */
|
||||
ptxdesc->txdw0 |= cpu_to_le32(OWN | FSG | LSG);
|
||||
ptxdesc->txdw0 |= cpu_to_le32(sz & 0x0000ffff);/* update TXPKTSIZE */
|
||||
|
||||
|
@ -226,12 +213,13 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
|
|||
|
||||
ptxdesc->txdw0 |= cpu_to_le32(((offset) << OFFSET_SHT) & 0x00ff0000);/* 32 bytes for TX Desc */
|
||||
|
||||
if (bmcst) ptxdesc->txdw0 |= cpu_to_le32(BMC);
|
||||
if (bmcst)
|
||||
ptxdesc->txdw0 |= cpu_to_le32(BMC);
|
||||
|
||||
if (padapter->registrypriv.mp_mode == 0) {
|
||||
if (!bagg_pkt){
|
||||
if ((pull) && (pxmitframe->pkt_offset>0))
|
||||
pxmitframe->pkt_offset = pxmitframe->pkt_offset -1;
|
||||
if (adapt->registrypriv.mp_mode == 0) {
|
||||
if (!bagg_pkt) {
|
||||
if ((pull) && (pxmitframe->pkt_offset > 0))
|
||||
pxmitframe->pkt_offset = pxmitframe->pkt_offset - 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -242,49 +230,41 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
|
|||
/* driver uses rate */
|
||||
ptxdesc->txdw4 |= cpu_to_le32(USERATE);/* rate control always by driver */
|
||||
|
||||
if ((pxmitframe->frame_tag&0x0f) == DATA_FRAMETAG)
|
||||
{
|
||||
|
||||
if ((pxmitframe->frame_tag & 0x0f) == DATA_FRAMETAG) {
|
||||
/* offset 4 */
|
||||
ptxdesc->txdw1 |= cpu_to_le32(pattrib->mac_id&0x3F);
|
||||
ptxdesc->txdw1 |= cpu_to_le32(pattrib->mac_id & 0x3F);
|
||||
|
||||
qsel = (uint)(pattrib->qsel & 0x0000001f);
|
||||
ptxdesc->txdw1 |= cpu_to_le32((qsel << QSEL_SHT) & 0x00001f00);
|
||||
|
||||
ptxdesc->txdw1 |= cpu_to_le32((pattrib->raid<< RATE_ID_SHT) & 0x000F0000);
|
||||
ptxdesc->txdw1 |= cpu_to_le32((pattrib->raid << RATE_ID_SHT) & 0x000F0000);
|
||||
|
||||
fill_txdesc_sectype(pattrib, ptxdesc);
|
||||
|
||||
if (pattrib->ampdu_en==true){
|
||||
if (pattrib->ampdu_en) {
|
||||
ptxdesc->txdw2 |= cpu_to_le32(AGG_EN);/* AGG EN */
|
||||
|
||||
ptxdesc->txdw6 = cpu_to_le32(0x6666f800);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
ptxdesc->txdw2 |= cpu_to_le32(AGG_BK);/* AGG BK */
|
||||
}
|
||||
|
||||
/* offset 8 */
|
||||
|
||||
|
||||
/* offset 12 */
|
||||
ptxdesc->txdw3 |= cpu_to_le32((pattrib->seqnum<< SEQ_SHT)&0x0FFF0000);
|
||||
|
||||
ptxdesc->txdw3 |= cpu_to_le32((pattrib->seqnum << SEQ_SHT) & 0x0FFF0000);
|
||||
|
||||
/* offset 16 , offset 20 */
|
||||
if (pattrib->qos_en)
|
||||
ptxdesc->txdw4 |= cpu_to_le32(QOS);/* QoS */
|
||||
|
||||
/* offset 20 */
|
||||
if (pxmitframe->agg_num > 1){
|
||||
if (pxmitframe->agg_num > 1)
|
||||
ptxdesc->txdw5 |= cpu_to_le32((pxmitframe->agg_num << USB_TXAGG_NUM_SHT) & 0xFF000000);
|
||||
}
|
||||
|
||||
if ((pattrib->ether_type != 0x888e) &&
|
||||
(pattrib->ether_type != 0x0806) &&
|
||||
(pattrib->ether_type != 0x88b4) &&
|
||||
(pattrib->dhcp_pkt != 1))
|
||||
{
|
||||
(pattrib->dhcp_pkt != 1)) {
|
||||
/* Non EAP & ARP & DHCP type data packet */
|
||||
|
||||
fill_txdesc_vcs(pattrib, &ptxdesc->txdw4);
|
||||
|
@ -293,38 +273,31 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
|
|||
ptxdesc->txdw4 |= cpu_to_le32(0x00000008);/* RTS Rate=24M */
|
||||
ptxdesc->txdw5 |= cpu_to_le32(0x0001ff00);/* DATA/RTS Rate FB LMT */
|
||||
|
||||
if (pattrib->ht_en){
|
||||
if ( ODM_RA_GetShortGI_8188E(&pHalData->odmpriv,pattrib->mac_id))
|
||||
if (pattrib->ht_en) {
|
||||
if (ODM_RA_GetShortGI_8188E(&haldata->odmpriv, pattrib->mac_id))
|
||||
ptxdesc->txdw5 |= cpu_to_le32(SGI);/* SGI */
|
||||
}
|
||||
|
||||
data_rate =ODM_RA_GetDecisionRate_8188E(&pHalData->odmpriv,pattrib->mac_id);
|
||||
data_rate = ODM_RA_GetDecisionRate_8188E(&haldata->odmpriv, pattrib->mac_id);
|
||||
ptxdesc->txdw5 |= cpu_to_le32(data_rate & 0x3F);
|
||||
|
||||
pwr_status = ODM_RA_GetHwPwrStatus_8188E(&pHalData->odmpriv,pattrib->mac_id);
|
||||
ptxdesc->txdw4 |=cpu_to_le32( (pwr_status & 0x7)<< PWR_STATUS_SHT);
|
||||
pwr_status = ODM_RA_GetHwPwrStatus_8188E(&haldata->odmpriv, pattrib->mac_id);
|
||||
ptxdesc->txdw4 |= cpu_to_le32((pwr_status & 0x7) << PWR_STATUS_SHT);
|
||||
} else {
|
||||
/* EAP data packet and ARP packet and DHCP. */
|
||||
/* Use the 1M data rate to send the EAP/ARP packet. */
|
||||
/* This will maybe make the handshake smooth. */
|
||||
|
||||
ptxdesc->txdw2 |= cpu_to_le32(AGG_BK);/* AGG BK */
|
||||
|
||||
if (pmlmeinfo->preamble_mode == PREAMBLE_SHORT)
|
||||
ptxdesc->txdw4 |= cpu_to_le32(BIT(24));/* DATA_SHORT */
|
||||
|
||||
ptxdesc->txdw5 |= cpu_to_le32(MRateToHwRate(pmlmeext->tx_rate));
|
||||
}
|
||||
} else if ((pxmitframe->frame_tag&0x0f)== MGNT_FRAMETAG) {
|
||||
|
||||
} else if ((pxmitframe->frame_tag&0x0f) == MGNT_FRAMETAG) {
|
||||
/* offset 4 */
|
||||
ptxdesc->txdw1 |= cpu_to_le32(pattrib->mac_id&0x3f);
|
||||
ptxdesc->txdw1 |= cpu_to_le32(pattrib->mac_id & 0x3f);
|
||||
|
||||
qsel = (uint)(pattrib->qsel&0x0000001f);
|
||||
ptxdesc->txdw1 |= cpu_to_le32((qsel<<QSEL_SHT)&0x00001f00);
|
||||
|
||||
ptxdesc->txdw1 |= cpu_to_le32((pattrib->raid<< RATE_ID_SHT) & 0x000f0000);
|
||||
ptxdesc->txdw1 |= cpu_to_le32((qsel << QSEL_SHT) & 0x00001f00);
|
||||
|
||||
ptxdesc->txdw1 |= cpu_to_le32((pattrib->raid << RATE_ID_SHT) & 0x000f0000);
|
||||
|
||||
/* offset 8 */
|
||||
/* CCX-TXRPT ack for xmit mgmt frames. */
|
||||
|
@ -336,30 +309,24 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
|
|||
|
||||
/* offset 20 */
|
||||
ptxdesc->txdw5 |= cpu_to_le32(RTY_LMT_EN);/* retry limit enable */
|
||||
if (pattrib->retry_ctrl == true)
|
||||
if (pattrib->retry_ctrl)
|
||||
ptxdesc->txdw5 |= cpu_to_le32(0x00180000);/* retry limit = 6 */
|
||||
else
|
||||
ptxdesc->txdw5 |= cpu_to_le32(0x00300000);/* retry limit = 12 */
|
||||
|
||||
ptxdesc->txdw5 |= cpu_to_le32(MRateToHwRate(pmlmeext->tx_rate));
|
||||
}
|
||||
else if ((pxmitframe->frame_tag&0x0f) == TXAGG_FRAMETAG)
|
||||
{
|
||||
} else if ((pxmitframe->frame_tag&0x0f) == TXAGG_FRAMETAG) {
|
||||
DBG_88E("pxmitframe->frame_tag == TXAGG_FRAMETAG\n");
|
||||
}
|
||||
else if (((pxmitframe->frame_tag&0x0f) == MP_FRAMETAG) &&
|
||||
(padapter->registrypriv.mp_mode == 1))
|
||||
{
|
||||
fill_txdesc_for_mp(padapter, ptxdesc);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else if (((pxmitframe->frame_tag&0x0f) == MP_FRAMETAG) &&
|
||||
(adapt->registrypriv.mp_mode == 1)) {
|
||||
fill_txdesc_for_mp(adapt, ptxdesc);
|
||||
} else {
|
||||
DBG_88E("pxmitframe->frame_tag = %d\n", pxmitframe->frame_tag);
|
||||
|
||||
/* offset 4 */
|
||||
ptxdesc->txdw1 |= cpu_to_le32((4)&0x3f);/* CAM_ID(MAC_ID) */
|
||||
ptxdesc->txdw1 |= cpu_to_le32((4) & 0x3f);/* CAM_ID(MAC_ID) */
|
||||
|
||||
ptxdesc->txdw1 |= cpu_to_le32((6<< RATE_ID_SHT) & 0x000f0000);/* raid */
|
||||
ptxdesc->txdw1 |= cpu_to_le32((6 << RATE_ID_SHT) & 0x000f0000);/* raid */
|
||||
|
||||
/* offset 8 */
|
||||
|
||||
|
@ -378,87 +345,74 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
|
|||
/* (2) Enable HW SEQ control for beacon packet, because we use Hw beacon. */
|
||||
/* (3) Use HW Qos SEQ to control the seq num of Ext port non-Qos packets. */
|
||||
/* 2010.06.23. Added by tynli. */
|
||||
if (!pattrib->qos_en)
|
||||
{
|
||||
if (!pattrib->qos_en) {
|
||||
ptxdesc->txdw3 |= cpu_to_le32(EN_HWSEQ); /* Hw set sequence number */
|
||||
ptxdesc->txdw4 |= cpu_to_le32(HW_SSN); /* Hw set sequence number */
|
||||
|
||||
}
|
||||
|
||||
ODM_SetTxAntByTxInfo_88E(&pHalData->odmpriv, pmem, pattrib->mac_id);
|
||||
ODM_SetTxAntByTxInfo_88E(&haldata->odmpriv, pmem, pattrib->mac_id);
|
||||
|
||||
rtl8188eu_cal_txdesc_chksum(ptxdesc);
|
||||
_dbg_dump_tx_info(padapter,pxmitframe->frame_tag,ptxdesc);
|
||||
_dbg_dump_tx_info(adapt, pxmitframe->frame_tag, ptxdesc);
|
||||
return pull;
|
||||
}
|
||||
|
||||
/* for non-agg data frame or management frame */
|
||||
static s32 rtw_dump_xframe(struct adapter *padapter, struct xmit_frame *pxmitframe)
|
||||
static s32 rtw_dump_xframe(struct adapter *adapt, struct xmit_frame *pxmitframe)
|
||||
{
|
||||
s32 ret = _SUCCESS;
|
||||
s32 inner_ret = _SUCCESS;
|
||||
int t, sz, w_sz, pull=0;
|
||||
int t, sz, w_sz, pull = 0;
|
||||
u8 *mem_addr;
|
||||
u32 ff_hwaddr;
|
||||
struct xmit_buf *pxmitbuf = pxmitframe->pxmitbuf;
|
||||
struct pkt_attrib *pattrib = &pxmitframe->attrib;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||
struct xmit_priv *pxmitpriv = &adapt->xmitpriv;
|
||||
struct security_priv *psecuritypriv = &adapt->securitypriv;
|
||||
if ((pxmitframe->frame_tag == DATA_FRAMETAG) &&
|
||||
(pxmitframe->attrib.ether_type != 0x0806) &&
|
||||
(pxmitframe->attrib.ether_type != 0x888e) &&
|
||||
(pxmitframe->attrib.ether_type != 0x88b4) &&
|
||||
(pxmitframe->attrib.dhcp_pkt != 1))
|
||||
{
|
||||
rtw_issue_addbareq_cmd(padapter, pxmitframe);
|
||||
}
|
||||
rtw_issue_addbareq_cmd(adapt, pxmitframe);
|
||||
mem_addr = pxmitframe->buf_addr;
|
||||
|
||||
RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("rtw_dump_xframe()\n"));
|
||||
RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_dump_xframe()\n"));
|
||||
|
||||
for (t = 0; t < pattrib->nr_frags; t++)
|
||||
{
|
||||
for (t = 0; t < pattrib->nr_frags; t++) {
|
||||
if (inner_ret != _SUCCESS && ret == _SUCCESS)
|
||||
ret = _FAIL;
|
||||
|
||||
if (t != (pattrib->nr_frags - 1))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("pattrib->nr_frags=%d\n", pattrib->nr_frags));
|
||||
if (t != (pattrib->nr_frags - 1)) {
|
||||
RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("pattrib->nr_frags=%d\n", pattrib->nr_frags));
|
||||
|
||||
sz = pxmitpriv->frag_len;
|
||||
sz = sz - 4 - (psecuritypriv->sw_encrypt ? 0 : pattrib->icv_len);
|
||||
}
|
||||
else /* no frag */
|
||||
{
|
||||
} else {
|
||||
/* no frag */
|
||||
sz = pattrib->last_txcmdsz;
|
||||
}
|
||||
|
||||
pull = update_txdesc(pxmitframe, mem_addr, sz, false);
|
||||
|
||||
if (pull)
|
||||
{
|
||||
if (pull) {
|
||||
mem_addr += PACKET_OFFSET_SZ; /* pull txdesc head */
|
||||
|
||||
pxmitframe->buf_addr = mem_addr;
|
||||
|
||||
w_sz = sz + TXDESC_SIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
w_sz = sz + TXDESC_SIZE + PACKET_OFFSET_SZ;
|
||||
}
|
||||
ff_hwaddr = rtw_get_ff_hwaddr(pxmitframe);
|
||||
|
||||
inner_ret = rtw_write_port(padapter, ff_hwaddr, w_sz, (unsigned char*)pxmitbuf);
|
||||
inner_ret = rtw_write_port(adapt, ff_hwaddr, w_sz, (unsigned char *)pxmitbuf);
|
||||
|
||||
rtw_count_tx_stats(padapter, pxmitframe, sz);
|
||||
rtw_count_tx_stats(adapt, pxmitframe, sz);
|
||||
|
||||
RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("rtw_write_port, w_sz=%d\n", w_sz));
|
||||
RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_write_port, w_sz=%d\n", w_sz));
|
||||
|
||||
mem_addr += w_sz;
|
||||
|
||||
mem_addr = (u8 *)RND4(((size_t)(mem_addr)));
|
||||
|
||||
}
|
||||
|
||||
rtw_free_xmitframe(pxmitpriv, pxmitframe);
|
||||
|
@ -473,7 +427,7 @@ static u32 xmitframe_need_length(struct xmit_frame *pxmitframe)
|
|||
{
|
||||
struct pkt_attrib *pattrib = &pxmitframe->attrib;
|
||||
|
||||
u32 len = 0;
|
||||
u32 len = 0;
|
||||
|
||||
/* no consider fragement */
|
||||
len = pattrib->hdrlen + pattrib->iv_len +
|
||||
|
@ -481,15 +435,15 @@ static u32 xmitframe_need_length(struct xmit_frame *pxmitframe)
|
|||
pattrib->pktlen +
|
||||
((pattrib->bswenc) ? pattrib->icv_len : 0);
|
||||
|
||||
if (pattrib->encrypt ==_TKIP_)
|
||||
if (pattrib->encrypt == _TKIP_)
|
||||
len += 8;
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
s32 rtl8188eu_xmitframe_complete(struct adapter *padapter, struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)
|
||||
s32 rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
struct xmit_frame *pxmitframe = NULL;
|
||||
struct xmit_frame *pfirstframe = NULL;
|
||||
|
||||
|
@ -498,29 +452,27 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *padapter, struct xmit_priv *pxm
|
|||
struct sta_info *psta = NULL;
|
||||
struct tx_servq *ptxservq = NULL;
|
||||
|
||||
unsigned long irqL;
|
||||
unsigned long irql;
|
||||
struct list_head *xmitframe_plist = NULL, *xmitframe_phead = NULL;
|
||||
|
||||
u32 pbuf; /* next pkt address */
|
||||
u32 pbuf_tail; /* last pkt tail */
|
||||
u32 len; /* packet length, except TXDESC_SIZE and PKT_OFFSET */
|
||||
u32 pbuf; /* next pkt address */
|
||||
u32 pbuf_tail; /* last pkt tail */
|
||||
u32 len; /* packet length, except TXDESC_SIZE and PKT_OFFSET */
|
||||
|
||||
u32 bulkSize = pHalData->UsbBulkOutSize;
|
||||
u8 descCount;
|
||||
u32 bulkPtr;
|
||||
u32 bulksize = haldata->UsbBulkOutSize;
|
||||
u8 desc_cnt;
|
||||
u32 bulkptr;
|
||||
|
||||
/* dump frame variable */
|
||||
u32 ff_hwaddr;
|
||||
|
||||
RT_TRACE(_module_rtl8192c_xmit_c_, _drv_info_, ("+xmitframe_complete\n"));
|
||||
|
||||
|
||||
/* check xmitbuffer is ok */
|
||||
if (pxmitbuf == NULL) {
|
||||
pxmitbuf = rtw_alloc_xmitbuf(pxmitpriv);
|
||||
if (pxmitbuf == NULL){
|
||||
if (pxmitbuf == NULL)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* 3 1. pick up first frame */
|
||||
|
@ -541,75 +493,70 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *padapter, struct xmit_priv *pxm
|
|||
pxmitframe->agg_num = 1; /* alloc xmitframe should assign to 1. */
|
||||
pxmitframe->pkt_offset = 1; /* first frame of aggregation, reserve offset */
|
||||
|
||||
rtw_xmitframe_coalesce(padapter, pxmitframe->pkt, pxmitframe);
|
||||
rtw_xmitframe_coalesce(adapt, pxmitframe->pkt, pxmitframe);
|
||||
|
||||
/* always return ndis_packet after rtw_xmitframe_coalesce */
|
||||
rtw_os_xmit_complete(padapter, pxmitframe);
|
||||
rtw_os_xmit_complete(adapt, pxmitframe);
|
||||
|
||||
break;
|
||||
} while (1);
|
||||
|
||||
/* 3 2. aggregate same priority and same DA(AP or STA) frames */
|
||||
pfirstframe = pxmitframe;
|
||||
len = xmitframe_need_length(pfirstframe) + TXDESC_SIZE+(pfirstframe->pkt_offset*PACKET_OFFSET_SZ);
|
||||
len = xmitframe_need_length(pfirstframe) + TXDESC_SIZE + (pfirstframe->pkt_offset*PACKET_OFFSET_SZ);
|
||||
pbuf_tail = len;
|
||||
pbuf = _RND8(pbuf_tail);
|
||||
|
||||
/* check pkt amount in one bulk */
|
||||
descCount = 0;
|
||||
bulkPtr = bulkSize;
|
||||
if (pbuf < bulkPtr)
|
||||
descCount++;
|
||||
else {
|
||||
descCount = 0;
|
||||
bulkPtr = ((pbuf / bulkSize) + 1) * bulkSize; /* round to next bulkSize */
|
||||
desc_cnt = 0;
|
||||
bulkptr = bulksize;
|
||||
if (pbuf < bulkptr) {
|
||||
desc_cnt++;
|
||||
} else {
|
||||
desc_cnt = 0;
|
||||
bulkptr = ((pbuf / bulksize) + 1) * bulksize; /* round to next bulksize */
|
||||
}
|
||||
|
||||
/* dequeue same priority packet from station tx queue */
|
||||
psta = pfirstframe->attrib.psta;
|
||||
switch (pfirstframe->attrib.priority) {
|
||||
case 1:
|
||||
case 2:
|
||||
ptxservq = &(psta->sta_xmitpriv.bk_q);
|
||||
phwxmit = pxmitpriv->hwxmits + 3;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
case 5:
|
||||
ptxservq = &(psta->sta_xmitpriv.vi_q);
|
||||
phwxmit = pxmitpriv->hwxmits + 1;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
case 7:
|
||||
ptxservq = &(psta->sta_xmitpriv.vo_q);
|
||||
phwxmit = pxmitpriv->hwxmits;
|
||||
break;
|
||||
|
||||
case 0:
|
||||
case 3:
|
||||
default:
|
||||
ptxservq = &(psta->sta_xmitpriv.be_q);
|
||||
phwxmit = pxmitpriv->hwxmits + 2;
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
ptxservq = &(psta->sta_xmitpriv.bk_q);
|
||||
phwxmit = pxmitpriv->hwxmits + 3;
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
ptxservq = &(psta->sta_xmitpriv.vi_q);
|
||||
phwxmit = pxmitpriv->hwxmits + 1;
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
ptxservq = &(psta->sta_xmitpriv.vo_q);
|
||||
phwxmit = pxmitpriv->hwxmits;
|
||||
break;
|
||||
case 0:
|
||||
case 3:
|
||||
default:
|
||||
ptxservq = &(psta->sta_xmitpriv.be_q);
|
||||
phwxmit = pxmitpriv->hwxmits + 2;
|
||||
break;
|
||||
}
|
||||
_enter_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
_enter_critical_bh(&pxmitpriv->lock, &irql);
|
||||
|
||||
xmitframe_phead = get_list_head(&ptxservq->sta_pending);
|
||||
xmitframe_plist = get_next(xmitframe_phead);
|
||||
|
||||
while (rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist) == false)
|
||||
{
|
||||
while (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) {
|
||||
pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list);
|
||||
xmitframe_plist = get_next(xmitframe_plist);
|
||||
|
||||
pxmitframe->agg_num = 0; /* not first frame of aggregation */
|
||||
pxmitframe->pkt_offset = 0; /* not first frame of aggregation, no need to reserve offset */
|
||||
|
||||
len = xmitframe_need_length(pxmitframe) + TXDESC_SIZE +(pxmitframe->pkt_offset*PACKET_OFFSET_SZ);
|
||||
len = xmitframe_need_length(pxmitframe) + TXDESC_SIZE + (pxmitframe->pkt_offset*PACKET_OFFSET_SZ);
|
||||
|
||||
if (_RND8(pbuf + len) > MAX_XMITBUF_SZ)
|
||||
{
|
||||
if (_RND8(pbuf + len) > MAX_XMITBUF_SZ) {
|
||||
pxmitframe->agg_num = 1;
|
||||
pxmitframe->pkt_offset = 1;
|
||||
break;
|
||||
|
@ -620,12 +567,12 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *padapter, struct xmit_priv *pxm
|
|||
|
||||
pxmitframe->buf_addr = pxmitbuf->pbuf + pbuf;
|
||||
|
||||
rtw_xmitframe_coalesce(padapter, pxmitframe->pkt, pxmitframe);
|
||||
rtw_xmitframe_coalesce(adapt, pxmitframe->pkt, pxmitframe);
|
||||
/* always return ndis_packet after rtw_xmitframe_coalesce */
|
||||
rtw_os_xmit_complete(padapter, pxmitframe);
|
||||
rtw_os_xmit_complete(adapt, pxmitframe);
|
||||
|
||||
/* (len - TXDESC_SIZE) == pxmitframe->attrib.last_txcmdsz */
|
||||
update_txdesc(pxmitframe, pxmitframe->buf_addr, pxmitframe->attrib.last_txcmdsz,true);
|
||||
update_txdesc(pxmitframe, pxmitframe->buf_addr, pxmitframe->attrib.last_txcmdsz, true);
|
||||
|
||||
/* don't need xmitframe any more */
|
||||
rtw_free_xmitframe(pxmitpriv, pxmitframe);
|
||||
|
@ -634,72 +581,63 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *padapter, struct xmit_priv *pxm
|
|||
pbuf_tail = pbuf + len;
|
||||
pbuf = _RND8(pbuf_tail);
|
||||
|
||||
|
||||
pfirstframe->agg_num++;
|
||||
if (MAX_TX_AGG_PACKET_NUMBER == pfirstframe->agg_num)
|
||||
break;
|
||||
|
||||
if (pbuf < bulkPtr) {
|
||||
descCount++;
|
||||
if (descCount == pHalData->UsbTxAggDescNum)
|
||||
if (pbuf < bulkptr) {
|
||||
desc_cnt++;
|
||||
if (desc_cnt == haldata->UsbTxAggDescNum)
|
||||
break;
|
||||
} else {
|
||||
descCount = 0;
|
||||
bulkPtr = ((pbuf / bulkSize) + 1) * bulkSize;
|
||||
desc_cnt = 0;
|
||||
bulkptr = ((pbuf / bulksize) + 1) * bulksize;
|
||||
}
|
||||
}/* end while ( aggregate same priority and same DA(AP or STA) frames) */
|
||||
|
||||
} /* end while (aggregate same priority and same DA(AP or STA) frames) */
|
||||
|
||||
if (_rtw_queue_empty(&ptxservq->sta_pending) == true)
|
||||
rtw_list_delete(&ptxservq->tx_pending);
|
||||
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irql);
|
||||
if ((pfirstframe->attrib.ether_type != 0x0806) &&
|
||||
(pfirstframe->attrib.ether_type != 0x888e) &&
|
||||
(pfirstframe->attrib.ether_type != 0x88b4) &&
|
||||
(pfirstframe->attrib.dhcp_pkt != 1))
|
||||
{
|
||||
rtw_issue_addbareq_cmd(padapter, pfirstframe);
|
||||
}
|
||||
rtw_issue_addbareq_cmd(adapt, pfirstframe);
|
||||
/* 3 3. update first frame txdesc */
|
||||
if ((pbuf_tail % bulkSize) == 0) {
|
||||
if ((pbuf_tail % bulksize) == 0) {
|
||||
/* remove pkt_offset */
|
||||
pbuf_tail -= PACKET_OFFSET_SZ;
|
||||
pfirstframe->buf_addr += PACKET_OFFSET_SZ;
|
||||
pfirstframe->pkt_offset--;
|
||||
}
|
||||
|
||||
update_txdesc(pfirstframe, pfirstframe->buf_addr, pfirstframe->attrib.last_txcmdsz,true);
|
||||
update_txdesc(pfirstframe, pfirstframe->buf_addr, pfirstframe->attrib.last_txcmdsz, true);
|
||||
|
||||
/* 3 4. write xmit buffer to USB FIFO */
|
||||
ff_hwaddr = rtw_get_ff_hwaddr(pfirstframe);
|
||||
rtw_write_port(padapter, ff_hwaddr, pbuf_tail, (u8*)pxmitbuf);
|
||||
|
||||
rtw_write_port(adapt, ff_hwaddr, pbuf_tail, (u8 *)pxmitbuf);
|
||||
|
||||
/* 3 5. update statisitc */
|
||||
pbuf_tail -= (pfirstframe->agg_num * TXDESC_SIZE);
|
||||
pbuf_tail -= (pfirstframe->pkt_offset * PACKET_OFFSET_SZ);
|
||||
|
||||
|
||||
rtw_count_tx_stats(padapter, pfirstframe, pbuf_tail);
|
||||
rtw_count_tx_stats(adapt, pfirstframe, pbuf_tail);
|
||||
|
||||
rtw_free_xmitframe(pxmitpriv, pfirstframe);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static s32 xmitframe_direct(struct adapter *padapter, struct xmit_frame *pxmitframe)
|
||||
static s32 xmitframe_direct(struct adapter *adapt, struct xmit_frame *pxmitframe)
|
||||
{
|
||||
s32 res = _SUCCESS;
|
||||
|
||||
res = rtw_xmitframe_coalesce(padapter, pxmitframe->pkt, pxmitframe);
|
||||
if (res == _SUCCESS) {
|
||||
rtw_dump_xframe(padapter, pxmitframe);
|
||||
}
|
||||
else{
|
||||
DBG_88E("==> %s xmitframe_coalsece failed\n",__func__);
|
||||
}
|
||||
|
||||
res = rtw_xmitframe_coalesce(adapt, pxmitframe->pkt, pxmitframe);
|
||||
if (res == _SUCCESS)
|
||||
rtw_dump_xframe(adapt, pxmitframe);
|
||||
else
|
||||
DBG_88E("==> %s xmitframe_coalsece failed\n", __func__);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -708,22 +646,19 @@ static s32 xmitframe_direct(struct adapter *padapter, struct xmit_frame *pxmitfr
|
|||
* true dump packet directly
|
||||
* false enqueue packet
|
||||
*/
|
||||
static s32 pre_xmitframe(struct adapter *padapter, struct xmit_frame *pxmitframe)
|
||||
static s32 pre_xmitframe(struct adapter *adapt, struct xmit_frame *pxmitframe)
|
||||
{
|
||||
unsigned long irqL;
|
||||
unsigned long irql;
|
||||
s32 res;
|
||||
struct xmit_buf *pxmitbuf = NULL;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
struct xmit_priv *pxmitpriv = &adapt->xmitpriv;
|
||||
struct pkt_attrib *pattrib = &pxmitframe->attrib;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct mlme_priv *pmlmepriv = &adapt->mlmepriv;
|
||||
|
||||
_enter_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
_enter_critical_bh(&pxmitpriv->lock, &irql);
|
||||
|
||||
if (rtw_txframes_sta_ac_pending(padapter, pattrib) > 0)
|
||||
{
|
||||
if (rtw_txframes_sta_ac_pending(adapt, pattrib) > 0)
|
||||
goto enqueue;
|
||||
}
|
||||
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == true)
|
||||
goto enqueue;
|
||||
|
@ -732,13 +667,13 @@ static s32 pre_xmitframe(struct adapter *padapter, struct xmit_frame *pxmitframe
|
|||
if (pxmitbuf == NULL)
|
||||
goto enqueue;
|
||||
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irql);
|
||||
|
||||
pxmitframe->pxmitbuf = pxmitbuf;
|
||||
pxmitframe->buf_addr = pxmitbuf->pbuf;
|
||||
pxmitbuf->priv_data = pxmitframe;
|
||||
|
||||
if (xmitframe_direct(padapter, pxmitframe) != _SUCCESS) {
|
||||
if (xmitframe_direct(adapt, pxmitframe) != _SUCCESS) {
|
||||
rtw_free_xmitbuf(pxmitpriv, pxmitbuf);
|
||||
rtw_free_xmitframe(pxmitpriv, pxmitframe);
|
||||
}
|
||||
|
@ -746,8 +681,8 @@ static s32 pre_xmitframe(struct adapter *padapter, struct xmit_frame *pxmitframe
|
|||
return true;
|
||||
|
||||
enqueue:
|
||||
res = rtw_xmitframe_enqueue(padapter, pxmitframe);
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
res = rtw_xmitframe_enqueue(adapt, pxmitframe);
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irql);
|
||||
|
||||
if (res != _SUCCESS) {
|
||||
RT_TRACE(_module_xmit_osdep_c_, _drv_err_, ("pre_xmitframe: enqueue xmitframe fail\n"));
|
||||
|
@ -762,9 +697,9 @@ enqueue:
|
|||
return false;
|
||||
}
|
||||
|
||||
s32 rtl8188eu_mgnt_xmit(struct adapter *padapter, struct xmit_frame *pmgntframe)
|
||||
s32 rtl8188eu_mgnt_xmit(struct adapter *adapt, struct xmit_frame *pmgntframe)
|
||||
{
|
||||
return rtw_dump_xframe(padapter, pmgntframe);
|
||||
return rtw_dump_xframe(adapt, pmgntframe);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -772,7 +707,7 @@ s32 rtl8188eu_mgnt_xmit(struct adapter *padapter, struct xmit_frame *pmgntframe)
|
|||
* true dump packet directly ok
|
||||
* false temporary can't transmit packets to hardware
|
||||
*/
|
||||
s32 rtl8188eu_hal_xmit(struct adapter *padapter, struct xmit_frame *pxmitframe)
|
||||
s32 rtl8188eu_hal_xmit(struct adapter *adapt, struct xmit_frame *pxmitframe)
|
||||
{
|
||||
return pre_xmitframe(padapter, pxmitframe);
|
||||
return pre_xmitframe(adapt, pxmitframe);
|
||||
}
|
||||
|
|
3367
hal/usb_halinit.c
3367
hal/usb_halinit.c
File diff suppressed because it is too large
Load diff
|
@ -29,106 +29,93 @@
|
|||
|
||||
static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 index, void *pdata, u16 len, u8 requesttype)
|
||||
{
|
||||
struct adapter *padapter = pintfhdl->padapter;
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
|
||||
struct usb_device *udev = pdvobjpriv->pusbdev;
|
||||
struct adapter *adapt = pintfhdl->padapter;
|
||||
struct dvobj_priv *dvobjpriv = adapter_to_dvobj(adapt);
|
||||
struct usb_device *udev = dvobjpriv->pusbdev;
|
||||
|
||||
unsigned int pipe;
|
||||
int status = 0;
|
||||
u32 tmp_buflen=0;
|
||||
u32 tmp_buflen = 0;
|
||||
u8 reqtype;
|
||||
u8 *pIo_buf;
|
||||
int vendorreq_times = 0;
|
||||
u8 tmp_buf[MAX_USB_IO_CTL_SIZE];
|
||||
|
||||
if ((padapter->bSurpriseRemoved) ||(padapter->pwrctrlpriv.pnp_bstop_trx)){
|
||||
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usbctrl_vendorreq:(padapter->bSurpriseRemoved ||adapter->pwrctrlpriv.pnp_bstop_trx)!!!\n"));
|
||||
if ((adapt->bSurpriseRemoved) || (adapt->pwrctrlpriv.pnp_bstop_trx)) {
|
||||
RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("usbctrl_vendorreq:(adapt->bSurpriseRemoved ||adapter->pwrctrlpriv.pnp_bstop_trx)!!!\n"));
|
||||
status = -EPERM;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (len>MAX_VENDOR_REQ_CMD_SIZE){
|
||||
DBG_88E( "[%s] Buffer len error ,vendor request failed\n", __func__ );
|
||||
if (len > MAX_VENDOR_REQ_CMD_SIZE) {
|
||||
DBG_88E("[%s] Buffer len error ,vendor request failed\n", __func__);
|
||||
status = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
_enter_critical_mutex(&pdvobjpriv->usb_vendor_req_mutex, NULL);
|
||||
_enter_critical_mutex(&dvobjpriv->usb_vendor_req_mutex, NULL);
|
||||
|
||||
/* Acquire IO memory for vendorreq */
|
||||
pIo_buf = pdvobjpriv->usb_vendor_req_buf;
|
||||
pIo_buf = dvobjpriv->usb_vendor_req_buf;
|
||||
|
||||
if ( pIo_buf== NULL) {
|
||||
DBG_88E( "[%s] pIo_buf == NULL\n", __func__ );
|
||||
if (pIo_buf == NULL) {
|
||||
DBG_88E("[%s] pIo_buf == NULL\n", __func__);
|
||||
status = -ENOMEM;
|
||||
goto release_mutex;
|
||||
}
|
||||
|
||||
while (++vendorreq_times<= MAX_USBCTRL_VENDORREQ_TIMES)
|
||||
{
|
||||
while (++vendorreq_times <= MAX_USBCTRL_VENDORREQ_TIMES) {
|
||||
_rtw_memset(pIo_buf, 0, len);
|
||||
|
||||
if (requesttype == 0x01)
|
||||
{
|
||||
if (requesttype == 0x01) {
|
||||
pipe = usb_rcvctrlpipe(udev, 0);/* read_in */
|
||||
reqtype = REALTEK_USB_VENQT_READ;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
pipe = usb_sndctrlpipe(udev, 0);/* write_out */
|
||||
reqtype = REALTEK_USB_VENQT_WRITE;
|
||||
_rtw_memcpy( pIo_buf, pdata, len);
|
||||
_rtw_memcpy(pIo_buf, pdata, len);
|
||||
}
|
||||
|
||||
status = rtw_usb_control_msg(udev, pipe, request, reqtype, value, index, pIo_buf, len, RTW_USB_CONTROL_MSG_TIMEOUT);
|
||||
|
||||
if ( status == len) /* Success this control transfer. */
|
||||
{
|
||||
rtw_reset_continual_urb_error(pdvobjpriv);
|
||||
if ( requesttype == 0x01 )
|
||||
{ /* For Control read transfer, we have to copy the read data from pIo_buf to pdata. */
|
||||
_rtw_memcpy( pdata, pIo_buf, len );
|
||||
}
|
||||
}
|
||||
else { /* error cases */
|
||||
DBG_88E("reg 0x%x, usb %s %u fail, status:%d value=0x%x, vendorreq_times:%d\n"
|
||||
, value,(requesttype == 0x01)?"read":"write" , len, status, *(u32*)pdata, vendorreq_times);
|
||||
if (status == len) { /* Success this control transfer. */
|
||||
rtw_reset_continual_urb_error(dvobjpriv);
|
||||
if (requesttype == 0x01)
|
||||
_rtw_memcpy(pdata, pIo_buf, len);
|
||||
} else { /* error cases */
|
||||
DBG_88E("reg 0x%x, usb %s %u fail, status:%d value=0x%x, vendorreq_times:%d\n",
|
||||
value, (requesttype == 0x01) ? "read" : "write",
|
||||
len, status, *(u32 *)pdata, vendorreq_times);
|
||||
|
||||
if (status < 0) {
|
||||
if (status == (-ESHUTDOWN) || status == -ENODEV )
|
||||
{
|
||||
padapter->bSurpriseRemoved = true;
|
||||
if (status == (-ESHUTDOWN) || status == -ENODEV) {
|
||||
adapt->bSurpriseRemoved = true;
|
||||
} else {
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
|
||||
pHalData->srestpriv.Wifi_Error_Status = USB_VEN_REQ_CMD_FAIL;
|
||||
}
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
haldata->srestpriv.Wifi_Error_Status = USB_VEN_REQ_CMD_FAIL;
|
||||
}
|
||||
}
|
||||
else /* status != len && status >= 0 */
|
||||
{
|
||||
} else { /* status != len && status >= 0 */
|
||||
if (status > 0) {
|
||||
if ( requesttype == 0x01 )
|
||||
{ /* For Control read transfer, we have to copy the read data from pIo_buf to pdata. */
|
||||
_rtw_memcpy( pdata, pIo_buf, len );
|
||||
if (requesttype == 0x01) {
|
||||
/* For Control read transfer, we have to copy the read data from pIo_buf to pdata. */
|
||||
_rtw_memcpy(pdata, pIo_buf, len);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rtw_inc_and_chk_continual_urb_error(pdvobjpriv) == true ){
|
||||
padapter->bSurpriseRemoved = true;
|
||||
if (rtw_inc_and_chk_continual_urb_error(dvobjpriv)) {
|
||||
adapt->bSurpriseRemoved = true;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* firmware download is checksumed, don't retry */
|
||||
if ( (value >= FW_8188E_START_ADDRESS && value <= FW_8188E_END_ADDRESS) || status == len )
|
||||
if ((value >= FW_8188E_START_ADDRESS && value <= FW_8188E_END_ADDRESS) || status == len)
|
||||
break;
|
||||
|
||||
}
|
||||
release_mutex:
|
||||
_exit_critical_mutex(&pdvobjpriv->usb_vendor_req_mutex, NULL);
|
||||
_exit_critical_mutex(&dvobjpriv->usb_vendor_req_mutex, NULL);
|
||||
exit:
|
||||
return status;
|
||||
}
|
||||
|
@ -140,7 +127,7 @@ static u8 usb_read8(struct intf_hdl *pintfhdl, u32 addr)
|
|||
u16 wvalue;
|
||||
u16 index;
|
||||
u16 len;
|
||||
u8 data=0;
|
||||
u8 data = 0;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
|
@ -216,22 +203,15 @@ static int usb_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val)
|
|||
int ret;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
request = 0x05;
|
||||
requesttype = 0x00;/* write_out */
|
||||
index = 0;/* n/a */
|
||||
|
||||
wvalue = (u16)(addr&0x0000ffff);
|
||||
len = 1;
|
||||
|
||||
data = val;
|
||||
|
||||
ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index, &data, len, requesttype);
|
||||
|
||||
ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index, &data, len, requesttype);
|
||||
_func_exit_;
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
static int usb_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val)
|
||||
|
@ -282,7 +262,7 @@ static int usb_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val)
|
|||
len = 4;
|
||||
data = cpu_to_le32(val);
|
||||
|
||||
ret =usbctrl_vendorreq(pintfhdl, request, wvalue, index, &data, len, requesttype);
|
||||
ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index, &data, len, requesttype);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
|
@ -296,7 +276,7 @@ static int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata
|
|||
u16 wvalue;
|
||||
u16 index;
|
||||
u16 len;
|
||||
u8 buf[VENDOR_CMD_MAX_DATA_LEN]={0};
|
||||
u8 buf[VENDOR_CMD_MAX_DATA_LEN] = {0};
|
||||
int ret;
|
||||
|
||||
_func_enter_;
|
||||
|
@ -307,34 +287,32 @@ static int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata
|
|||
|
||||
wvalue = (u16)(addr&0x0000ffff);
|
||||
len = length;
|
||||
_rtw_memcpy(buf, pdata, len );
|
||||
_rtw_memcpy(buf, pdata, len);
|
||||
|
||||
ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index, buf, len, requesttype);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
static void interrupt_handler_8188eu(struct adapter *padapter,u16 pkt_len,u8 *pbuf)
|
||||
static void interrupt_handler_8188eu(struct adapter *adapt, u16 pkt_len, u8 *pbuf)
|
||||
{
|
||||
struct hal_data_8188e *pHalData=GET_HAL_DATA(padapter);
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
struct reportpwrstate_parm pwr_rpt;
|
||||
|
||||
if ( pkt_len != INTERRUPT_MSG_FORMAT_LEN )
|
||||
{
|
||||
if (pkt_len != INTERRUPT_MSG_FORMAT_LEN) {
|
||||
DBG_88E("%s Invalid interrupt content length (%d)!\n", __func__, pkt_len);
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
|
||||
/* HISR */
|
||||
_rtw_memcpy(&(pHalData->IntArray[0]), &(pbuf[USB_INTR_CONTENT_HISR_OFFSET]), 4);
|
||||
_rtw_memcpy(&(pHalData->IntArray[1]), &(pbuf[USB_INTR_CONTENT_HISRE_OFFSET]), 4);
|
||||
_rtw_memcpy(&(haldata->IntArray[0]), &(pbuf[USB_INTR_CONTENT_HISR_OFFSET]), 4);
|
||||
_rtw_memcpy(&(haldata->IntArray[1]), &(pbuf[USB_INTR_CONTENT_HISRE_OFFSET]), 4);
|
||||
|
||||
/* C2H Event */
|
||||
if (pbuf[0]!= 0)
|
||||
_rtw_memcpy(&(pHalData->C2hArray[0]), &(pbuf[USB_INTR_CONTENT_C2H_OFFSET]), 16);
|
||||
if (pbuf[0] != 0)
|
||||
_rtw_memcpy(&(haldata->C2hArray[0]), &(pbuf[USB_INTR_CONTENT_C2H_OFFSET]), 16);
|
||||
}
|
||||
|
||||
static s32 pre_recv_entry(union recv_frame *precvframe, struct recv_stat *prxstat, struct phy_stat *pphy_status)
|
||||
|
@ -342,7 +320,7 @@ static s32 pre_recv_entry(union recv_frame *precvframe, struct recv_stat *prxsta
|
|||
return _SUCCESS;
|
||||
}
|
||||
|
||||
static int recvbuf2recvframe(struct adapter *padapter, struct sk_buff *pskb)
|
||||
static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
|
||||
{
|
||||
u8 *pbuf;
|
||||
u8 shift_sz = 0;
|
||||
|
@ -354,17 +332,17 @@ static int recvbuf2recvframe(struct adapter *padapter, struct sk_buff *pskb)
|
|||
struct sk_buff *pkt_copy = NULL;
|
||||
union recv_frame *precvframe = NULL;
|
||||
struct rx_pkt_attrib *pattrib = NULL;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
|
||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
struct recv_priv *precvpriv = &adapt->recvpriv;
|
||||
struct __queue *pfree_recv_queue = &precvpriv->free_recv_queue;
|
||||
|
||||
transfer_len = (s32)pskb->len;
|
||||
pbuf = pskb->data;
|
||||
|
||||
prxstat = (struct recv_stat *)pbuf;
|
||||
pkt_cnt = (le32_to_cpu(prxstat->rxdw2)>>16) & 0xff;
|
||||
pkt_cnt = (le32_to_cpu(prxstat->rxdw2) >> 16) & 0xff;
|
||||
|
||||
do{
|
||||
do {
|
||||
RT_TRACE(_module_rtl871x_recv_c_, _drv_info_,
|
||||
("recvbuf2recvframe: rxdesc=offsset 0:0x%08x, 4:0x%08x, 8:0x%08x, C:0x%08x\n",
|
||||
prxstat->rxdw0, prxstat->rxdw1, prxstat->rxdw2, prxstat->rxdw4));
|
||||
|
@ -372,121 +350,104 @@ static int recvbuf2recvframe(struct adapter *padapter, struct sk_buff *pskb)
|
|||
prxstat = (struct recv_stat *)pbuf;
|
||||
|
||||
precvframe = rtw_alloc_recvframe(pfree_recv_queue);
|
||||
if (precvframe==NULL)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("recvbuf2recvframe: precvframe==NULL\n"));
|
||||
if (precvframe == NULL) {
|
||||
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("recvbuf2recvframe: precvframe==NULL\n"));
|
||||
DBG_88E("%s()-%d: rtw_alloc_recvframe() failed! RX Drop!\n", __func__, __LINE__);
|
||||
goto _exit_recvbuf2recvframe;
|
||||
}
|
||||
|
||||
_rtw_init_listhead(&precvframe->u.hdr.list);
|
||||
precvframe->u.hdr.precvbuf = NULL; /* can't access the precvbuf for new arch. */
|
||||
precvframe->u.hdr.len=0;
|
||||
precvframe->u.hdr.len = 0;
|
||||
|
||||
update_recvframe_attrib_88e(precvframe, prxstat);
|
||||
|
||||
pattrib = &precvframe->u.hdr.attrib;
|
||||
|
||||
if ((pattrib->crc_err) || (pattrib->icv_err))
|
||||
{
|
||||
if ((pattrib->crc_err) || (pattrib->icv_err)) {
|
||||
DBG_88E("%s: RX Warning! crc_err=%d icv_err=%d, skip!\n", __func__, pattrib->crc_err, pattrib->icv_err);
|
||||
|
||||
rtw_free_recvframe(precvframe, pfree_recv_queue);
|
||||
goto _exit_recvbuf2recvframe;
|
||||
}
|
||||
|
||||
if ( (pattrib->physt) && (pattrib->pkt_rpt_type == NORMAL_RX))
|
||||
{
|
||||
if ((pattrib->physt) && (pattrib->pkt_rpt_type == NORMAL_RX))
|
||||
pphy_status = (struct phy_stat *)(pbuf + RXDESC_OFFSET);
|
||||
}
|
||||
|
||||
pkt_offset = RXDESC_SIZE + pattrib->drvinfo_sz + pattrib->shift_sz + pattrib->pkt_len;
|
||||
|
||||
if ((pattrib->pkt_len<=0) || (pkt_offset>transfer_len))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("recvbuf2recvframe: pkt_len<=0\n"));
|
||||
if ((pattrib->pkt_len <= 0) || (pkt_offset > transfer_len)) {
|
||||
RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("recvbuf2recvframe: pkt_len<=0\n"));
|
||||
DBG_88E("%s()-%d: RX Warning!,pkt_len<=0 or pkt_offset> transfoer_len\n", __func__, __LINE__);
|
||||
rtw_free_recvframe(precvframe, pfree_recv_queue);
|
||||
goto _exit_recvbuf2recvframe;
|
||||
}
|
||||
|
||||
/* Modified by Albert 20101213 */
|
||||
/* For 8 bytes IP header alignment. */
|
||||
if (pattrib->qos) /* Qos data, wireless lan header length is 26 */
|
||||
{
|
||||
/* Modified by Albert 20101213 */
|
||||
/* For 8 bytes IP header alignment. */
|
||||
if (pattrib->qos) /* Qos data, wireless lan header length is 26 */
|
||||
shift_sz = 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
shift_sz = 0;
|
||||
}
|
||||
|
||||
skb_len = pattrib->pkt_len;
|
||||
|
||||
/* for first fragment packet, driver need allocate 1536+drvinfo_sz+RXDESC_SIZE to defrag packet. */
|
||||
/* modify alloc_sz for recvive crc error packet by thomas 2011-06-02 */
|
||||
if ((pattrib->mfrag == 1)&&(pattrib->frag_num == 0)){
|
||||
if ((pattrib->mfrag == 1) && (pattrib->frag_num == 0)) {
|
||||
if (skb_len <= 1650)
|
||||
alloc_sz = 1664;
|
||||
else
|
||||
alloc_sz = skb_len + 14;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
alloc_sz = skb_len;
|
||||
/* 6 is for IP header 8 bytes alignment in QoS packet case. */
|
||||
/* 8 is for skb->data 4 bytes alignment. */
|
||||
/* 6 is for IP header 8 bytes alignment in QoS packet case. */
|
||||
/* 8 is for skb->data 4 bytes alignment. */
|
||||
alloc_sz += 14;
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)) /* www.mail-archive.com/netdev@vger.kernel.org/msg17214.html */
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18))
|
||||
pkt_copy = dev_alloc_skb(alloc_sz);
|
||||
#else
|
||||
pkt_copy = netdev_alloc_skb(padapter->pnetdev, alloc_sz);
|
||||
pkt_copy = netdev_alloc_skb(adapt->pnetdev, alloc_sz);
|
||||
#endif
|
||||
if (pkt_copy)
|
||||
{
|
||||
pkt_copy->dev = padapter->pnetdev;
|
||||
if (pkt_copy) {
|
||||
pkt_copy->dev = adapt->pnetdev;
|
||||
precvframe->u.hdr.pkt = pkt_copy;
|
||||
precvframe->u.hdr.rx_head = pkt_copy->data;
|
||||
precvframe->u.hdr.rx_end = pkt_copy->data + alloc_sz;
|
||||
skb_reserve( pkt_copy, 8 - ((size_t)( pkt_copy->data ) & 7 ));/* force pkt_copy->data at 8-byte alignment address */
|
||||
skb_reserve( pkt_copy, shift_sz );/* force ip_hdr at 8-byte alignment address according to shift_sz. */
|
||||
skb_reserve(pkt_copy, 8 - ((size_t)(pkt_copy->data) & 7));/* force pkt_copy->data at 8-byte alignment address */
|
||||
skb_reserve(pkt_copy, shift_sz);/* force ip_hdr at 8-byte alignment address according to shift_sz. */
|
||||
_rtw_memcpy(pkt_copy->data, (pbuf + pattrib->drvinfo_sz + RXDESC_SIZE), skb_len);
|
||||
precvframe->u.hdr.rx_data = precvframe->u.hdr.rx_tail = pkt_copy->data;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((pattrib->mfrag == 1)&&(pattrib->frag_num == 0))
|
||||
{
|
||||
precvframe->u.hdr.rx_tail = pkt_copy->data;
|
||||
precvframe->u.hdr.rx_data = pkt_copy->data;
|
||||
} else {
|
||||
if ((pattrib->mfrag == 1) && (pattrib->frag_num == 0)) {
|
||||
DBG_88E("recvbuf2recvframe: alloc_skb fail , drop frag frame\n");
|
||||
rtw_free_recvframe(precvframe, pfree_recv_queue);
|
||||
goto _exit_recvbuf2recvframe;
|
||||
}
|
||||
|
||||
precvframe->u.hdr.pkt = skb_clone(pskb, GFP_ATOMIC);
|
||||
if (precvframe->u.hdr.pkt)
|
||||
{
|
||||
precvframe->u.hdr.rx_head = precvframe->u.hdr.rx_data = precvframe->u.hdr.rx_tail
|
||||
= pbuf+ pattrib->drvinfo_sz + RXDESC_SIZE;
|
||||
precvframe->u.hdr.rx_end = pbuf +pattrib->drvinfo_sz + RXDESC_SIZE+ alloc_sz;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (precvframe->u.hdr.pkt) {
|
||||
precvframe->u.hdr.rx_tail = pbuf + pattrib->drvinfo_sz + RXDESC_SIZE;
|
||||
precvframe->u.hdr.rx_head = precvframe->u.hdr.rx_tail;
|
||||
precvframe->u.hdr.rx_data = precvframe->u.hdr.rx_tail;
|
||||
precvframe->u.hdr.rx_end = pbuf + pattrib->drvinfo_sz + RXDESC_SIZE + alloc_sz;
|
||||
} else {
|
||||
DBG_88E("recvbuf2recvframe: skb_clone fail\n");
|
||||
rtw_free_recvframe(precvframe, pfree_recv_queue);
|
||||
goto _exit_recvbuf2recvframe;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
recvframe_put(precvframe, skb_len);
|
||||
|
||||
switch (pHalData->UsbRxAggMode) {
|
||||
switch (haldata->UsbRxAggMode) {
|
||||
case USB_RX_AGG_DMA:
|
||||
case USB_RX_AGG_MIX:
|
||||
pkt_offset = (u16)_RND128(pkt_offset);
|
||||
break;
|
||||
case USB_RX_AGG_USB:
|
||||
case USB_RX_AGG_USB:
|
||||
pkt_offset = (u16)_RND4(pkt_offset);
|
||||
break;
|
||||
case USB_RX_AGG_DISABLE:
|
||||
|
@ -495,26 +456,26 @@ static int recvbuf2recvframe(struct adapter *padapter, struct sk_buff *pskb)
|
|||
}
|
||||
if (pattrib->pkt_rpt_type == NORMAL_RX) { /* Normal rx packet */
|
||||
if (pattrib->physt)
|
||||
update_recvframe_phyinfo_88e(precvframe, (struct phy_stat*)pphy_status);
|
||||
update_recvframe_phyinfo_88e(precvframe, (struct phy_stat *)pphy_status);
|
||||
if (rtw_recv_entry(precvframe) != _SUCCESS) {
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,
|
||||
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_,
|
||||
("recvbuf2recvframe: rtw_recv_entry(precvframe) != _SUCCESS\n"));
|
||||
}
|
||||
} else {
|
||||
/* enqueue recvframe to txrtp queue */
|
||||
if (pattrib->pkt_rpt_type == TX_REPORT1) {
|
||||
/* CCX-TXRPT ack for xmit mgmt frames. */
|
||||
handle_txrpt_ccx_88e(padapter, precvframe->u.hdr.rx_data);
|
||||
handle_txrpt_ccx_88e(adapt, precvframe->u.hdr.rx_data);
|
||||
} else if (pattrib->pkt_rpt_type == TX_REPORT2) {
|
||||
ODM_RA_TxRPT2Handle_8188E(
|
||||
&pHalData->odmpriv,
|
||||
&haldata->odmpriv,
|
||||
precvframe->u.hdr.rx_data,
|
||||
pattrib->pkt_len,
|
||||
pattrib->MacIDValidEntry[0],
|
||||
pattrib->MacIDValidEntry[1]
|
||||
);
|
||||
} else if (pattrib->pkt_rpt_type == HIS_REPORT) {
|
||||
interrupt_handler_8188eu(padapter,pattrib->pkt_len,precvframe->u.hdr.rx_data);
|
||||
interrupt_handler_8188eu(adapt, pattrib->pkt_len, precvframe->u.hdr.rx_data);
|
||||
}
|
||||
rtw_free_recvframe(precvframe, pfree_recv_queue);
|
||||
}
|
||||
|
@ -537,16 +498,16 @@ _exit_recvbuf2recvframe:
|
|||
void rtl8188eu_recv_tasklet(void *priv)
|
||||
{
|
||||
struct sk_buff *pskb;
|
||||
struct adapter *padapter = (struct adapter*)priv;
|
||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
struct adapter *adapt = (struct adapter *)priv;
|
||||
struct recv_priv *precvpriv = &adapt->recvpriv;
|
||||
|
||||
while (NULL != (pskb = skb_dequeue(&precvpriv->rx_skb_queue))) {
|
||||
if ((padapter->bDriverStopped == true) || (padapter->bSurpriseRemoved == true)) {
|
||||
if ((adapt->bDriverStopped) || (adapt->bSurpriseRemoved)) {
|
||||
DBG_88E("recv_tasklet => bDriverStopped or bSurpriseRemoved\n");
|
||||
dev_kfree_skb_any(pskb);
|
||||
break;
|
||||
}
|
||||
recvbuf2recvframe(padapter, pskb);
|
||||
recvbuf2recvframe(adapt, pskb);
|
||||
skb_reset_tail_pointer(pskb);
|
||||
pskb->len = 0;
|
||||
skb_queue_tail(&precvpriv->free_recv_skb_queue, pskb);
|
||||
|
@ -555,75 +516,75 @@ void rtl8188eu_recv_tasklet(void *priv)
|
|||
|
||||
static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
|
||||
{
|
||||
unsigned long irqL;
|
||||
unsigned long irql;
|
||||
uint isevt, *pbuf;
|
||||
struct recv_buf *precvbuf = (struct recv_buf *)purb->context;
|
||||
struct adapter *padapter =(struct adapter *)precvbuf->adapter;
|
||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
struct adapter *adapt = (struct adapter *)precvbuf->adapter;
|
||||
struct recv_priv *precvpriv = &adapt->recvpriv;
|
||||
|
||||
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete!!!\n"));
|
||||
RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("usb_read_port_complete!!!\n"));
|
||||
|
||||
precvpriv->rx_pending_cnt --;
|
||||
precvpriv->rx_pending_cnt--;
|
||||
|
||||
if (padapter->bSurpriseRemoved || padapter->bDriverStopped || padapter->bReadPortCancel) {
|
||||
if (adapt->bSurpriseRemoved || adapt->bDriverStopped || adapt->bReadPortCancel) {
|
||||
RT_TRACE(_module_hci_ops_os_c_, _drv_err_,
|
||||
("usb_read_port_complete:bDriverStopped(%d) OR bSurpriseRemoved(%d)\n",
|
||||
padapter->bDriverStopped, padapter->bSurpriseRemoved));
|
||||
adapt->bDriverStopped, adapt->bSurpriseRemoved));
|
||||
|
||||
precvbuf->reuse = true;
|
||||
DBG_88E("%s() RX Warning! bDriverStopped(%d) OR bSurpriseRemoved(%d) bReadPortCancel(%d)\n",
|
||||
__func__, padapter->bDriverStopped,
|
||||
padapter->bSurpriseRemoved, padapter->bReadPortCancel);
|
||||
__func__, adapt->bDriverStopped,
|
||||
adapt->bSurpriseRemoved, adapt->bReadPortCancel);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (purb->status==0) {/* SUCCESS */
|
||||
if (purb->status == 0) { /* SUCCESS */
|
||||
if ((purb->actual_length > MAX_RECVBUF_SZ) || (purb->actual_length < RXDESC_SIZE)) {
|
||||
RT_TRACE(_module_hci_ops_os_c_, _drv_err_,
|
||||
("usb_read_port_complete: (purb->actual_length > MAX_RECVBUF_SZ) || (purb->actual_length < RXDESC_SIZE)\n"));
|
||||
precvbuf->reuse = true;
|
||||
rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
|
||||
rtw_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
|
||||
DBG_88E("%s()-%d: RX Warning!\n", __func__, __LINE__);
|
||||
} else {
|
||||
rtw_reset_continual_urb_error(adapter_to_dvobj(padapter));
|
||||
rtw_reset_continual_urb_error(adapter_to_dvobj(adapt));
|
||||
|
||||
precvbuf->transfer_len = purb->actual_length;
|
||||
skb_put(precvbuf->pskb, purb->actual_length);
|
||||
skb_queue_tail(&precvpriv->rx_skb_queue, precvbuf->pskb);
|
||||
|
||||
if (skb_queue_len(&precvpriv->rx_skb_queue)<=1)
|
||||
if (skb_queue_len(&precvpriv->rx_skb_queue) <= 1)
|
||||
tasklet_schedule(&precvpriv->recv_tasklet);
|
||||
|
||||
precvbuf->pskb = NULL;
|
||||
precvbuf->reuse = false;
|
||||
rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
|
||||
rtw_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
|
||||
}
|
||||
} else {
|
||||
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete : purb->status(%d) != 0\n", purb->status));
|
||||
RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("usb_read_port_complete : purb->status(%d) != 0\n", purb->status));
|
||||
|
||||
DBG_88E("###=> usb_read_port_complete => urb status(%d)\n", purb->status);
|
||||
|
||||
if (rtw_inc_and_chk_continual_urb_error(adapter_to_dvobj(padapter)) == true )
|
||||
padapter->bSurpriseRemoved = true;
|
||||
if (rtw_inc_and_chk_continual_urb_error(adapter_to_dvobj(adapt)))
|
||||
adapt->bSurpriseRemoved = true;
|
||||
|
||||
switch (purb->status) {
|
||||
case -EINVAL:
|
||||
case -EPIPE:
|
||||
case -ENODEV:
|
||||
case -ESHUTDOWN:
|
||||
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bSurpriseRemoved=true\n"));
|
||||
RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("usb_read_port_complete:bSurpriseRemoved=true\n"));
|
||||
case -ENOENT:
|
||||
padapter->bDriverStopped=true;
|
||||
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bDriverStopped=true\n"));
|
||||
adapt->bDriverStopped = true;
|
||||
RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("usb_read_port_complete:bDriverStopped=true\n"));
|
||||
break;
|
||||
case -EPROTO:
|
||||
case -EOVERFLOW:
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
|
||||
pHalData->srestpriv.Wifi_Error_Status = USB_READ_PORT_FAIL;
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
haldata->srestpriv.Wifi_Error_Status = USB_READ_PORT_FAIL;
|
||||
}
|
||||
precvbuf->reuse = true;
|
||||
rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
|
||||
rtw_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
|
||||
break;
|
||||
case -EINPROGRESS:
|
||||
DBG_88E("ERROR: URB IS IN PROGRESS!/n");
|
||||
|
@ -639,13 +600,13 @@ _func_exit_;
|
|||
|
||||
static u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem)
|
||||
{
|
||||
unsigned long irqL;
|
||||
unsigned long irql;
|
||||
int err;
|
||||
unsigned int pipe;
|
||||
size_t tmpaddr=0;
|
||||
size_t alignment=0;
|
||||
size_t tmpaddr = 0;
|
||||
size_t alignment = 0;
|
||||
u32 ret = _SUCCESS;
|
||||
struct urb * purb = NULL;
|
||||
struct urb *purb = NULL;
|
||||
struct recv_buf *precvbuf = (struct recv_buf *)rmem;
|
||||
struct adapter *adapter = pintfhdl->padapter;
|
||||
struct dvobj_priv *pdvobj = adapter_to_dvobj(adapter);
|
||||
|
@ -657,12 +618,13 @@ _func_enter_;
|
|||
if (adapter->bDriverStopped || adapter->bSurpriseRemoved ||
|
||||
adapter->pwrctrlpriv.pnp_bstop_trx) {
|
||||
RT_TRACE(_module_hci_ops_os_c_, _drv_err_,
|
||||
("usb_read_port:( padapter->bDriverStopped ||padapter->bSurpriseRemoved ||adapter->pwrctrlpriv.pnp_bstop_trx)!!!\n"));
|
||||
("usb_read_port:(adapt->bDriverStopped ||adapt->bSurpriseRemoved ||adapter->pwrctrlpriv.pnp_bstop_trx)!!!\n"));
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
if ((precvbuf->reuse == false) || (precvbuf->pskb == NULL)) {
|
||||
if (NULL != (precvbuf->pskb = skb_dequeue(&precvpriv->free_recv_skb_queue)))
|
||||
if ((!precvbuf->reuse) || (precvbuf->pskb == NULL)) {
|
||||
precvbuf->pskb = skb_dequeue(&precvpriv->free_recv_skb_queue);
|
||||
if (NULL != precvbuf->pskb)
|
||||
precvbuf->reuse = true;
|
||||
}
|
||||
|
||||
|
@ -670,14 +632,14 @@ _func_enter_;
|
|||
rtl8188eu_init_recvbuf(adapter, precvbuf);
|
||||
|
||||
/* re-assign for linux based on skb */
|
||||
if ((precvbuf->reuse == false) || (precvbuf->pskb == NULL)) {
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)) /* www.mail-archive.com/netdev@vger.kernel.org/msg17214.html */
|
||||
if ((!precvbuf->reuse) || (precvbuf->pskb == NULL)) {
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18))
|
||||
precvbuf->pskb = dev_alloc_skb(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ);
|
||||
#else
|
||||
precvbuf->pskb = netdev_alloc_skb(adapter->pnetdev, MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ);
|
||||
#endif
|
||||
if (precvbuf->pskb == NULL) {
|
||||
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("init_recvbuf(): alloc_skb fail!\n"));
|
||||
RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("init_recvbuf(): alloc_skb fail!\n"));
|
||||
DBG_88E("#### usb_read_port() alloc_skb fail!#####\n");
|
||||
return _FAIL;
|
||||
}
|
||||
|
@ -736,23 +698,23 @@ _func_exit_;
|
|||
void rtl8188eu_xmit_tasklet(void *priv)
|
||||
{
|
||||
int ret = false;
|
||||
struct adapter *padapter = (struct adapter*)priv;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
struct adapter *adapt = (struct adapter *)priv;
|
||||
struct xmit_priv *pxmitpriv = &adapt->xmitpriv;
|
||||
|
||||
if (check_fwstate(&padapter->mlmepriv, _FW_UNDER_SURVEY) == true)
|
||||
if (check_fwstate(&adapt->mlmepriv, _FW_UNDER_SURVEY))
|
||||
return;
|
||||
|
||||
while (1) {
|
||||
if ((padapter->bDriverStopped == true)||
|
||||
(padapter->bSurpriseRemoved== true) ||
|
||||
(padapter->bWritePortCancel == true)) {
|
||||
if ((adapt->bDriverStopped) ||
|
||||
(adapt->bSurpriseRemoved) ||
|
||||
(adapt->bWritePortCancel)) {
|
||||
DBG_88E("xmit_tasklet => bDriverStopped or bSurpriseRemoved or bWritePortCancel\n");
|
||||
break;
|
||||
}
|
||||
|
||||
ret = rtl8188eu_xmitframe_complete(padapter, pxmitpriv, NULL);
|
||||
ret = rtl8188eu_xmitframe_complete(adapt, pxmitpriv, NULL);
|
||||
|
||||
if (ret==false)
|
||||
if (!ret)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -777,9 +739,9 @@ void rtl8188eu_set_intf_ops(struct _io_ops *pops)
|
|||
_func_exit_;
|
||||
}
|
||||
|
||||
void rtl8188eu_set_hw_type(struct adapter *padapter)
|
||||
void rtl8188eu_set_hw_type(struct adapter *adapt)
|
||||
{
|
||||
padapter->chip_type = RTL8188E;
|
||||
padapter->HardwareType = HARDWARE_TYPE_RTL8188EU;
|
||||
adapt->chip_type = RTL8188E;
|
||||
adapt->HardwareType = HARDWARE_TYPE_RTL8188EU;
|
||||
DBG_88E("CHIP TYPE: RTL8188E\n");
|
||||
}
|
||||
|
|
|
@ -496,5 +496,7 @@ void rtl8188e_stop_thread(struct adapter *padapter);
|
|||
|
||||
void rtw_IOL_cmd_tx_pkt_buf_dump(struct adapter *Adapter,int data_len);
|
||||
s32 rtl8188e_iol_efuse_patch(struct adapter * padapter);
|
||||
void rtw_cancel_all_timer(struct adapter *padapter);
|
||||
void _ps_open_RF(struct adapter *adapt);
|
||||
|
||||
#endif //__RTL8188E_HAL_H__
|
||||
|
|
Loading…
Reference in a new issue