mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-06-23 08:34:20 +00:00
rtl8188eu: Fix some sparse warnings
The driver did not work on PowerPC, which is big endian. This patch fixes all the sparse warnings concerning improper use of __le16 and __le32 variables. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
77e8b5de91
commit
7c7f632ac7
25 changed files with 502 additions and 684 deletions
|
@ -190,70 +190,66 @@ void update_recvframe_attrib_88e(
|
|||
|
||||
//phdr = &precvframe->u.hdr;
|
||||
|
||||
report.rxdw0 = le32_to_cpu(prxstat->rxdw0);
|
||||
report.rxdw1 = le32_to_cpu(prxstat->rxdw1);
|
||||
report.rxdw2 = le32_to_cpu(prxstat->rxdw2);
|
||||
report.rxdw3 = le32_to_cpu(prxstat->rxdw3);
|
||||
report.rxdw4 = le32_to_cpu(prxstat->rxdw4);
|
||||
report.rxdw5 = le32_to_cpu(prxstat->rxdw5);
|
||||
report.rxdw0 = prxstat->rxdw0;
|
||||
report.rxdw1 = prxstat->rxdw1;
|
||||
report.rxdw2 = prxstat->rxdw2;
|
||||
report.rxdw3 = prxstat->rxdw3;
|
||||
report.rxdw4 = prxstat->rxdw4;
|
||||
report.rxdw5 = prxstat->rxdw5;
|
||||
|
||||
prxreport = (PRXREPORT)&report;
|
||||
|
||||
pattrib = &precvframe->u.hdr.attrib;
|
||||
_rtw_memset(pattrib, 0, sizeof(struct rx_pkt_attrib));
|
||||
|
||||
pattrib->crc_err = (u8)((report.rxdw0 >> 14) & 0x1);;//(u8)prxreport->crc32;
|
||||
pattrib->crc_err = (u8)((le32_to_cpu(report.rxdw0) >> 14) & 0x1);;//(u8)prxreport->crc32;
|
||||
|
||||
// update rx report to recv_frame attribute
|
||||
pattrib->pkt_rpt_type = (u8)((report.rxdw3 >> 14) & 0x3);//prxreport->rpt_sel;
|
||||
pattrib->pkt_rpt_type = (u8)((le32_to_cpu(report.rxdw3) >> 14) & 0x3);//prxreport->rpt_sel;
|
||||
|
||||
if(pattrib->pkt_rpt_type == NORMAL_RX)//Normal rx packet
|
||||
{
|
||||
pattrib->pkt_len = (u16)(report.rxdw0 &0x00003fff);//(u16)prxreport->pktlen;
|
||||
pattrib->drvinfo_sz = (u8)((report.rxdw0 >> 16) & 0xf) * 8;//(u8)(prxreport->drvinfosize << 3);
|
||||
pattrib->pkt_len = (u16)(le32_to_cpu(report.rxdw0) &0x00003fff);//(u16)prxreport->pktlen;
|
||||
pattrib->drvinfo_sz = (u8)((le32_to_cpu(report.rxdw0) >> 16) & 0xf) * 8;//(u8)(prxreport->drvinfosize << 3);
|
||||
|
||||
pattrib->physt = (u8)((report.rxdw0 >> 26) & 0x1);//(u8)prxreport->physt;
|
||||
pattrib->physt = (u8)((le32_to_cpu(report.rxdw0) >> 26) & 0x1);//(u8)prxreport->physt;
|
||||
|
||||
pattrib->bdecrypted = (report.rxdw0 & BIT(27))? 0:1;//(u8)(prxreport->swdec ? 0 : 1);
|
||||
pattrib->encrypt = (u8)((report.rxdw0 >> 20) & 0x7);//(u8)prxreport->security;
|
||||
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)((report.rxdw0 >> 23) & 0x1);//(u8)prxreport->qos;
|
||||
pattrib->priority = (u8)((report.rxdw1 >> 8) & 0xf);//(u8)prxreport->tid;
|
||||
pattrib->qos = (u8)((le32_to_cpu(report.rxdw0) >> 23) & 0x1);//(u8)prxreport->qos;
|
||||
pattrib->priority = (u8)((le32_to_cpu(report.rxdw1) >> 8) & 0xf);//(u8)prxreport->tid;
|
||||
|
||||
pattrib->amsdu = (u8)((report.rxdw1 >> 13) & 0x1);//(u8)prxreport->amsdu;
|
||||
pattrib->amsdu = (u8)((le32_to_cpu(report.rxdw1) >> 13) & 0x1);//(u8)prxreport->amsdu;
|
||||
|
||||
pattrib->seq_num = (u16)(report.rxdw2 & 0x00000fff);//(u16)prxreport->seq;
|
||||
pattrib->frag_num = (u8)((report.rxdw2 >> 12) & 0xf);//(u8)prxreport->frag;
|
||||
pattrib->mfrag = (u8)((report.rxdw1 >> 27) & 0x1);//(u8)prxreport->mf;
|
||||
pattrib->mdata = (u8)((report.rxdw1 >> 26) & 0x1);//(u8)prxreport->md;
|
||||
pattrib->seq_num = (u16)(le32_to_cpu(report.rxdw2) & 0x00000fff);//(u16)prxreport->seq;
|
||||
pattrib->frag_num = (u8)((le32_to_cpu(report.rxdw2) >> 12) & 0xf);//(u8)prxreport->frag;
|
||||
pattrib->mfrag = (u8)((le32_to_cpu(report.rxdw1) >> 27) & 0x1);//(u8)prxreport->mf;
|
||||
pattrib->mdata = (u8)((le32_to_cpu(report.rxdw1) >> 26) & 0x1);//(u8)prxreport->md;
|
||||
|
||||
pattrib->mcs_rate = (u8)(report.rxdw3 & 0x3f);//(u8)prxreport->rxmcs;
|
||||
pattrib->rxht = (u8)((report.rxdw3 >> 6) & 0x1);//(u8)prxreport->rxht;
|
||||
pattrib->mcs_rate = (u8)(le32_to_cpu(report.rxdw3) & 0x3f);//(u8)prxreport->rxmcs;
|
||||
pattrib->rxht = (u8)((le32_to_cpu(report.rxdw3) >> 6) & 0x1);//(u8)prxreport->rxht;
|
||||
|
||||
pattrib->icv_err = (u8)((report.rxdw0 >> 15) & 0x1);//(u8)prxreport->icverr;
|
||||
pattrib->shift_sz = (u8)((report.rxdw0 >> 24) & 0x3);
|
||||
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
|
||||
{
|
||||
} 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)(report.rxdw0 & 0x3FF);//Rx length[9: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->drvinfo_sz = 0;
|
||||
|
||||
//
|
||||
// Get TX report MAC ID valid.
|
||||
//
|
||||
pattrib->MacIDValidEntry[0] = report.rxdw4;
|
||||
pattrib->MacIDValidEntry[1] = report.rxdw5;
|
||||
pattrib->MacIDValidEntry[0] = le32_to_cpu(report.rxdw4);
|
||||
pattrib->MacIDValidEntry[1] = le32_to_cpu(report.rxdw5);
|
||||
|
||||
}
|
||||
else if(pattrib->pkt_rpt_type == HIS_REPORT)// USB HISR RPT
|
||||
{
|
||||
pattrib->pkt_len = (u16)(report.rxdw0 &0x00003fff);//(u16)prxreport->pktlen;
|
||||
pattrib->pkt_len = (u16)(le32_to_cpu(report.rxdw0) &0x00003fff);//(u16)prxreport->pktlen;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue