mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-06 21:43:06 +00:00
rtl8188eu: Remove CONFIG_TX_EARLY_MODE - not defined
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
3184153e26
commit
44346186dd
7 changed files with 3 additions and 263 deletions
|
@ -96,186 +96,3 @@ void _dbg_dump_tx_info(_adapter *padapter,int frame_tag,struct tx_desc *ptxdesc)
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Description:
|
||||
* Aggregation packets and send to hardware
|
||||
*
|
||||
* Return:
|
||||
* 0 Success
|
||||
* -1 Hardware resource(TX FIFO) not ready
|
||||
* -2 Software resource(xmitbuf) not ready
|
||||
*/
|
||||
#ifdef CONFIG_TX_EARLY_MODE
|
||||
|
||||
/* define DBG_EMINFO */
|
||||
|
||||
#if RTL8188E_EARLY_MODE_PKT_NUM_10 == 1
|
||||
#define EARLY_MODE_MAX_PKT_NUM 10
|
||||
#else
|
||||
#define EARLY_MODE_MAX_PKT_NUM 5
|
||||
#endif
|
||||
|
||||
|
||||
struct EMInfo{
|
||||
u8 EMPktNum;
|
||||
u16 EMPktLen[EARLY_MODE_MAX_PKT_NUM];
|
||||
};
|
||||
|
||||
|
||||
void
|
||||
InsertEMContent_8188E(
|
||||
struct EMInfo *pEMInfo,
|
||||
pu1Byte VirtualAddress)
|
||||
{
|
||||
|
||||
#if RTL8188E_EARLY_MODE_PKT_NUM_10 == 1
|
||||
u1Byte index=0;
|
||||
u4Byte dwtmp=0;
|
||||
#endif
|
||||
|
||||
_rtw_memset(VirtualAddress, 0, EARLY_MODE_INFO_SIZE);
|
||||
if (pEMInfo->EMPktNum==0)
|
||||
return;
|
||||
|
||||
#ifdef DBG_EMINFO
|
||||
{
|
||||
int i;
|
||||
DBG_88E("\n%s ==> pEMInfo->EMPktNum =%d\n",__func__,pEMInfo->EMPktNum);
|
||||
for (i=0;i< EARLY_MODE_MAX_PKT_NUM;i++){
|
||||
DBG_88E("%s ==> pEMInfo->EMPktLen[%d] =%d\n",__func__,i,pEMInfo->EMPktLen[i]);
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#if RTL8188E_EARLY_MODE_PKT_NUM_10 == 1
|
||||
SET_EARLYMODE_PKTNUM(VirtualAddress, pEMInfo->EMPktNum);
|
||||
|
||||
if (pEMInfo->EMPktNum == 1){
|
||||
dwtmp = pEMInfo->EMPktLen[0];
|
||||
}else{
|
||||
dwtmp = pEMInfo->EMPktLen[0];
|
||||
dwtmp += ((dwtmp%4)?(4-dwtmp%4):0)+4;
|
||||
dwtmp += pEMInfo->EMPktLen[1];
|
||||
}
|
||||
SET_EARLYMODE_LEN0(VirtualAddress, dwtmp);
|
||||
if (pEMInfo->EMPktNum <= 3){
|
||||
dwtmp = pEMInfo->EMPktLen[2];
|
||||
}else{
|
||||
dwtmp = pEMInfo->EMPktLen[2];
|
||||
dwtmp += ((dwtmp%4)?(4-dwtmp%4):0)+4;
|
||||
dwtmp += pEMInfo->EMPktLen[3];
|
||||
}
|
||||
SET_EARLYMODE_LEN1(VirtualAddress, dwtmp);
|
||||
if (pEMInfo->EMPktNum <= 5){
|
||||
dwtmp = pEMInfo->EMPktLen[4];
|
||||
}else{
|
||||
dwtmp = pEMInfo->EMPktLen[4];
|
||||
dwtmp += ((dwtmp%4)?(4-dwtmp%4):0)+4;
|
||||
dwtmp += pEMInfo->EMPktLen[5];
|
||||
}
|
||||
SET_EARLYMODE_LEN2_1(VirtualAddress, dwtmp&0xF);
|
||||
SET_EARLYMODE_LEN2_2(VirtualAddress, dwtmp>>4);
|
||||
if (pEMInfo->EMPktNum <= 7){
|
||||
dwtmp = pEMInfo->EMPktLen[6];
|
||||
}else{
|
||||
dwtmp = pEMInfo->EMPktLen[6];
|
||||
dwtmp += ((dwtmp%4)?(4-dwtmp%4):0)+4;
|
||||
dwtmp += pEMInfo->EMPktLen[7];
|
||||
}
|
||||
SET_EARLYMODE_LEN3(VirtualAddress, dwtmp);
|
||||
if (pEMInfo->EMPktNum <= 9){
|
||||
dwtmp = pEMInfo->EMPktLen[8];
|
||||
}else{
|
||||
dwtmp = pEMInfo->EMPktLen[8];
|
||||
dwtmp += ((dwtmp%4)?(4-dwtmp%4):0)+4;
|
||||
dwtmp += pEMInfo->EMPktLen[9];
|
||||
}
|
||||
SET_EARLYMODE_LEN4(VirtualAddress, dwtmp);
|
||||
#else
|
||||
SET_EARLYMODE_PKTNUM(VirtualAddress, pEMInfo->EMPktNum);
|
||||
SET_EARLYMODE_LEN0(VirtualAddress, pEMInfo->EMPktLen[0]);
|
||||
SET_EARLYMODE_LEN1(VirtualAddress, pEMInfo->EMPktLen[1]);
|
||||
SET_EARLYMODE_LEN2_1(VirtualAddress, pEMInfo->EMPktLen[2]&0xF);
|
||||
SET_EARLYMODE_LEN2_2(VirtualAddress, pEMInfo->EMPktLen[2]>>4);
|
||||
SET_EARLYMODE_LEN3(VirtualAddress, pEMInfo->EMPktLen[3]);
|
||||
SET_EARLYMODE_LEN4(VirtualAddress, pEMInfo->EMPktLen[4]);
|
||||
#endif
|
||||
}
|
||||
|
||||
void UpdateEarlyModeInfo8188E(struct xmit_priv *pxmitpriv,struct xmit_buf *pxmitbuf )
|
||||
{
|
||||
int index,j;
|
||||
u16 offset,pktlen;
|
||||
PTXDESC ptxdesc;
|
||||
|
||||
u8 *pmem,*pEMInfo_mem;
|
||||
s8 node_num_0=0,node_num_1=0;
|
||||
struct EMInfo eminfo;
|
||||
struct agg_pkt_info *paggpkt;
|
||||
struct xmit_frame *pframe = (struct xmit_frame*)pxmitbuf->priv_data;
|
||||
pmem= pframe->buf_addr;
|
||||
|
||||
#ifdef DBG_EMINFO
|
||||
DBG_88E("\n%s ==> agg_num:%d\n",__func__, pframe->agg_num);
|
||||
for (index=0;index<pframe->agg_num;index++){
|
||||
offset = pxmitpriv->agg_pkt[index].offset;
|
||||
pktlen = pxmitpriv->agg_pkt[index].pkt_len;
|
||||
DBG_88E("%s ==> agg_pkt[%d].offset=%d\n",__func__,index,offset);
|
||||
DBG_88E("%s ==> agg_pkt[%d].pkt_len=%d\n",__func__,index,pktlen);
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( pframe->agg_num > EARLY_MODE_MAX_PKT_NUM)
|
||||
{
|
||||
node_num_0 = pframe->agg_num;
|
||||
node_num_1= EARLY_MODE_MAX_PKT_NUM-1;
|
||||
}
|
||||
|
||||
for (index=0;index<pframe->agg_num;index++){
|
||||
|
||||
offset = pxmitpriv->agg_pkt[index].offset;
|
||||
pktlen = pxmitpriv->agg_pkt[index].pkt_len;
|
||||
|
||||
_rtw_memset(&eminfo,0,sizeof(struct EMInfo));
|
||||
if ( pframe->agg_num > EARLY_MODE_MAX_PKT_NUM){
|
||||
if (node_num_0 > EARLY_MODE_MAX_PKT_NUM){
|
||||
eminfo.EMPktNum = EARLY_MODE_MAX_PKT_NUM;
|
||||
node_num_0--;
|
||||
}
|
||||
else{
|
||||
eminfo.EMPktNum = node_num_1;
|
||||
node_num_1--;
|
||||
}
|
||||
}
|
||||
else{
|
||||
eminfo.EMPktNum = pframe->agg_num-(index+1);
|
||||
}
|
||||
for (j=0;j< eminfo.EMPktNum ;j++){
|
||||
eminfo.EMPktLen[j] = pxmitpriv->agg_pkt[index+1+j].pkt_len+4;/* 4 bytes CRC */
|
||||
}
|
||||
|
||||
if (pmem){
|
||||
if (index==0){
|
||||
ptxdesc = (PTXDESC)(pmem);
|
||||
pEMInfo_mem = ((u8 *)ptxdesc)+TXDESC_SIZE;
|
||||
}
|
||||
else{
|
||||
pmem = pmem + pxmitpriv->agg_pkt[index-1].offset;
|
||||
ptxdesc = (PTXDESC)(pmem);
|
||||
pEMInfo_mem = ((u8 *)ptxdesc)+TXDESC_SIZE;
|
||||
}
|
||||
|
||||
#ifdef DBG_EMINFO
|
||||
DBG_88E("%s ==> desc.pkt_len=%d\n",__func__,ptxdesc->pktlen);
|
||||
#endif
|
||||
InsertEMContent_8188E(&eminfo,pEMInfo_mem);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
_rtw_memset(pxmitpriv->agg_pkt,0,sizeof(struct agg_pkt_info)*MAX_AGG_PKT_NUM);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -35,10 +35,6 @@ s32 rtl8188eu_init_xmit_priv(_adapter *padapter)
|
|||
tasklet_init(&pxmitpriv->xmit_tasklet,
|
||||
(void(*)(unsigned long))rtl8188eu_xmit_tasklet,
|
||||
(unsigned long)padapter);
|
||||
#ifdef CONFIG_TX_EARLY_MODE
|
||||
pHalData->bEarlyModeEnable = padapter->registrypriv.early_mode;
|
||||
#endif
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -229,11 +225,6 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
|
|||
|
||||
offset = TXDESC_SIZE + OFFSET_SZ;
|
||||
|
||||
#ifdef CONFIG_TX_EARLY_MODE
|
||||
if (bagg_pkt){
|
||||
offset += EARLY_MODE_INFO_SIZE ;/* 0x28 */
|
||||
}
|
||||
#endif
|
||||
ptxdesc->txdw0 |= cpu_to_le32(((offset) << OFFSET_SHT) & 0x00ff0000);/* 32 bytes for TX Desc */
|
||||
|
||||
if (bmcst) ptxdesc->txdw0 |= cpu_to_le32(BMC);
|
||||
|
@ -576,11 +567,7 @@ s32 rtl8188eu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv
|
|||
pxmitbuf->priv_data = pxmitframe;
|
||||
|
||||
pxmitframe->agg_num = 1; /* alloc xmitframe should assign to 1. */
|
||||
#ifdef CONFIG_TX_EARLY_MODE
|
||||
pxmitframe->pkt_offset = 2; /* first frame of aggregation, reserve one offset for EM info ,another for usb bulk-out block check */
|
||||
#else
|
||||
pxmitframe->pkt_offset = 1; /* first frame of aggregation, reserve offset */
|
||||
#endif
|
||||
|
||||
rtw_xmitframe_coalesce(padapter, pxmitframe->pkt, pxmitframe);
|
||||
|
||||
|
@ -644,12 +631,8 @@ s32 rtl8188eu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv
|
|||
pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list);
|
||||
xmitframe_plist = get_next(xmitframe_plist);
|
||||
|
||||
pxmitframe->agg_num = 0; /* not first frame of aggregation */
|
||||
#ifdef CONFIG_TX_EARLY_MODE
|
||||
pxmitframe->pkt_offset = 1;/* not first frame of aggregation,reserve offset for EM Info */
|
||||
#else
|
||||
pxmitframe->agg_num = 0; /* not first frame of aggregation */
|
||||
pxmitframe->pkt_offset = 0; /* not first frame of aggregation, no need to reserve offset */
|
||||
#endif
|
||||
|
||||
len = xmitframe_need_length(pxmitframe) + TXDESC_SIZE +(pxmitframe->pkt_offset*PACKET_OFFSET_SZ);
|
||||
|
||||
|
@ -681,10 +664,6 @@ s32 rtl8188eu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv
|
|||
|
||||
|
||||
pfirstframe->agg_num++;
|
||||
#ifdef CONFIG_TX_EARLY_MODE
|
||||
pxmitpriv->agg_pkt[pfirstframe->agg_num-1].offset = _RND8(len);
|
||||
pxmitpriv->agg_pkt[pfirstframe->agg_num-1].pkt_len = pxmitframe->attrib.last_txcmdsz;
|
||||
#endif
|
||||
if (MAX_TX_AGG_PACKET_NUMBER == pfirstframe->agg_num)
|
||||
break;
|
||||
|
||||
|
@ -722,14 +701,6 @@ s32 rtl8188eu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv
|
|||
|
||||
update_txdesc(pfirstframe, pfirstframe->buf_addr, pfirstframe->attrib.last_txcmdsz,true);
|
||||
|
||||
#ifdef CONFIG_TX_EARLY_MODE
|
||||
/* prepare EM info for first frame, agg_num value start from 1 */
|
||||
pxmitpriv->agg_pkt[0].offset = _RND8(pfirstframe->attrib.last_txcmdsz +TXDESC_SIZE +(pfirstframe->pkt_offset*PACKET_OFFSET_SZ));
|
||||
pxmitpriv->agg_pkt[0].pkt_len = pfirstframe->attrib.last_txcmdsz;/* get from rtw_xmitframe_coalesce */
|
||||
|
||||
UpdateEarlyModeInfo8188E(pxmitpriv,pxmitbuf );
|
||||
#endif
|
||||
|
||||
/* 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);
|
||||
|
|
|
@ -1418,30 +1418,7 @@ _func_enter_;
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TX_EARLY_MODE
|
||||
if ( pHalData->bEarlyModeEnable)
|
||||
{
|
||||
RT_TRACE(_module_hci_hal_init_c_, _drv_info_,("EarlyMode Enabled!!!\n"));
|
||||
|
||||
value8 = rtw_read8(Adapter, REG_EARLY_MODE_CONTROL);
|
||||
#if RTL8188E_EARLY_MODE_PKT_NUM_10 == 1
|
||||
value8 = value8|0x1f;
|
||||
#else
|
||||
value8 = value8|0xf;
|
||||
#endif
|
||||
rtw_write8(Adapter, REG_EARLY_MODE_CONTROL, value8);
|
||||
|
||||
rtw_write8(Adapter, REG_EARLY_MODE_CONTROL+3, 0x80);
|
||||
|
||||
value8 = rtw_read8(Adapter, REG_TCR+1);
|
||||
value8 = value8|0x40;
|
||||
rtw_write8(Adapter,REG_TCR+1, value8);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
rtw_write8(Adapter, REG_EARLY_MODE_CONTROL, 0);
|
||||
}
|
||||
rtw_write8(Adapter, REG_EARLY_MODE_CONTROL, 0);
|
||||
|
||||
#ifdef CONFIG_CHECK_AC_LIFETIME
|
||||
/* Enable lifetime check for the four ACs */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue