mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-22 04:23:39 +00:00
rtl8188eu: Fix more sparse warnings
For the most part, these are all endian issues. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
d2c90ee304
commit
e5113c831c
15 changed files with 201 additions and 265 deletions
|
@ -340,10 +340,10 @@ _func_enter_;
|
|||
_func_exit_;
|
||||
}
|
||||
|
||||
void rtl8188e_set_FwMediaStatus_cmd(PADAPTER padapter, u16 mstatus_rpt )
|
||||
void rtl8188e_set_FwMediaStatus_cmd(PADAPTER padapter, __le16 mstatus_rpt )
|
||||
{
|
||||
u8 opmode,macid;
|
||||
u16 mst_rpt = cpu_to_le16 (mstatus_rpt);
|
||||
u16 mst_rpt = le16_to_cpu(mstatus_rpt);
|
||||
opmode = (u8) mst_rpt;
|
||||
macid = (u8)(mst_rpt >> 8) ;
|
||||
|
||||
|
|
|
@ -261,10 +261,10 @@ static void efuse_read_phymap_from_txpktbuf(
|
|||
lenc[0] = rtw_read8(adapter, REG_PKTBUF_DBG_DATA_L);
|
||||
lenc[1] = rtw_read8(adapter, REG_PKTBUF_DBG_DATA_L+1);
|
||||
|
||||
aaabak = le16_to_cpup((u16*)lenc);
|
||||
lenbak = le16_to_cpu(*((u16*)lenc));
|
||||
aaa = le16_to_cpup((u16*)&lo32);
|
||||
len = le16_to_cpu(*((u16*)&lo32));
|
||||
aaabak = le16_to_cpup((__le16 *)lenc);
|
||||
lenbak = le16_to_cpu(*((__le16 *)lenc));
|
||||
aaa = le16_to_cpup((__le16 *)&lo32);
|
||||
len = le16_to_cpu(*((__le16 *)&lo32));
|
||||
|
||||
limit = (len-2<limit)?len-2:limit;
|
||||
|
||||
|
@ -2850,7 +2850,7 @@ Hal_EfuseParseIDCode88E(
|
|||
|
||||
|
||||
// Checl 0x8129 again for making sure autoload status!!
|
||||
EEPROMId = le16_to_cpu(*((u16*)hwinfo));
|
||||
EEPROMId = le16_to_cpu(*((__le16 *)hwinfo));
|
||||
if (EEPROMId != RTL_EEPROM_ID)
|
||||
{
|
||||
DBG_88E("EEPROM ID(%#x) is invalid!!\n", EEPROMId);
|
||||
|
|
|
@ -186,68 +186,61 @@ void update_recvframe_attrib_88e(
|
|||
struct rx_pkt_attrib *pattrib;
|
||||
struct recv_stat report;
|
||||
|
||||
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;
|
||||
|
||||
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);
|
||||
if (pattrib->pkt_rpt_type == NORMAL_RX) { //Normal rx packet
|
||||
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;
|
||||
} else if (pattrib->pkt_rpt_type == HIS_REPORT) { // USB HISR RPT
|
||||
pattrib->pkt_len = (u16)(le32_to_cpu(report.rxdw0) &0x00003fff);//(u16)prxreport->pktlen;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ static void rtl8188eu_cal_txdesc_chksum(struct tx_desc *ptxdesc)
|
|||
ptxdesc->txdw7 &= cpu_to_le32(0xffff0000);
|
||||
|
||||
for (index = 0; index < count; index++)
|
||||
checksum = checksum ^ le16_to_cpu(*(usPtr + index));
|
||||
checksum = checksum ^ le16_to_cpu(*(__le16 *)(usPtr + index));
|
||||
ptxdesc->txdw7 |= cpu_to_le32(0x0000ffff&checksum);
|
||||
}
|
||||
//
|
||||
|
|
|
@ -2030,8 +2030,8 @@ Hal_EfuseParsePIDVID_8188EU(
|
|||
if ( !AutoLoadFail )
|
||||
{
|
||||
// VID, PID
|
||||
pHalData->EEPROMVID = EF2Byte( *(u16 *)&hwinfo[EEPROM_VID_88EU] );
|
||||
pHalData->EEPROMPID = EF2Byte( *(u16 *)&hwinfo[EEPROM_PID_88EU] );
|
||||
pHalData->EEPROMVID = EF2BYTE( *(__le16 *)&hwinfo[EEPROM_VID_88EU] );
|
||||
pHalData->EEPROMPID = EF2BYTE( *(__le16 *)&hwinfo[EEPROM_PID_88EU] );
|
||||
|
||||
// Customer ID, 0x00 and 0xff are reserved for Realtek.
|
||||
pHalData->EEPROMCustomerID = *(u8 *)&hwinfo[EEPROM_CUSTOMERID_88E];
|
||||
|
@ -3801,7 +3801,7 @@ _func_enter_;
|
|||
#endif
|
||||
case HW_VAR_H2C_MEDIA_STATUS_RPT:
|
||||
{
|
||||
rtl8188e_set_FwMediaStatus_cmd(Adapter , (*(u16 *)val));
|
||||
rtl8188e_set_FwMediaStatus_cmd(Adapter , (*(__le16 *)val));
|
||||
}
|
||||
break;
|
||||
case HW_VAR_BCN_VALID:
|
||||
|
|
|
@ -38,7 +38,7 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u
|
|||
{
|
||||
_adapter *padapter = pintfhdl->padapter;
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
|
||||
struct usb_device *udev=pdvobjpriv->pusbdev;
|
||||
struct usb_device *udev = pdvobjpriv->pusbdev;
|
||||
|
||||
unsigned int pipe;
|
||||
int status = 0;
|
||||
|
@ -48,9 +48,9 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u
|
|||
int vendorreq_times = 0;
|
||||
|
||||
#ifdef CONFIG_USB_VENDOR_REQ_BUFFER_DYNAMIC_ALLOCATE
|
||||
u8 *tmp_buf;
|
||||
u8 *tmp_buf;
|
||||
#else // use stack memory
|
||||
u8 tmp_buf[MAX_USB_IO_CTL_SIZE];
|
||||
u8 tmp_buf[MAX_USB_IO_CTL_SIZE];
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
|
@ -217,23 +217,18 @@ static u16 usb_read16(struct intf_hdl *pintfhdl, u32 addr)
|
|||
u16 wvalue;
|
||||
u16 index;
|
||||
u16 len;
|
||||
u16 data=0;
|
||||
|
||||
_func_enter_;
|
||||
__le32 data;
|
||||
|
||||
_func_enter_;
|
||||
request = 0x05;
|
||||
requesttype = 0x01;//read_in
|
||||
index = 0;//n/a
|
||||
|
||||
wvalue = (u16)(addr&0x0000ffff);
|
||||
len = 2;
|
||||
|
||||
usbctrl_vendorreq(pintfhdl, request, wvalue, index, &data, len, requesttype);
|
||||
_func_exit_;
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return data;
|
||||
|
||||
return (u16)(le32_to_cpu(data)&0xffff);
|
||||
}
|
||||
|
||||
static u32 usb_read32(struct intf_hdl *pintfhdl, u32 addr)
|
||||
|
@ -243,9 +238,9 @@ static u32 usb_read32(struct intf_hdl *pintfhdl, u32 addr)
|
|||
u16 wvalue;
|
||||
u16 index;
|
||||
u16 len;
|
||||
u32 data=0;
|
||||
__le32 data;
|
||||
|
||||
_func_enter_;
|
||||
_func_enter_;
|
||||
|
||||
request = 0x05;
|
||||
requesttype = 0x01;//read_in
|
||||
|
@ -256,10 +251,9 @@ static u32 usb_read32(struct intf_hdl *pintfhdl, u32 addr)
|
|||
|
||||
usbctrl_vendorreq(pintfhdl, request, wvalue, index, &data, len, requesttype);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return data;
|
||||
_func_exit_;
|
||||
|
||||
return le32_to_cpu(data);
|
||||
}
|
||||
|
||||
static int usb_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val)
|
||||
|
@ -298,7 +292,7 @@ static int usb_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val)
|
|||
u16 wvalue;
|
||||
u16 index;
|
||||
u16 len;
|
||||
u16 data;
|
||||
__le32 data;
|
||||
int ret;
|
||||
|
||||
_func_enter_;
|
||||
|
@ -310,14 +304,13 @@ static int usb_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val)
|
|||
wvalue = (u16)(addr&0x0000ffff);
|
||||
len = 2;
|
||||
|
||||
data = val;
|
||||
data = cpu_to_le32(val & 0x0000ffff);
|
||||
|
||||
ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index, &data, len, requesttype);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
static int usb_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val)
|
||||
|
@ -327,7 +320,7 @@ static int usb_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val)
|
|||
u16 wvalue;
|
||||
u16 index;
|
||||
u16 len;
|
||||
u32 data;
|
||||
__le32 data;
|
||||
int ret;
|
||||
|
||||
_func_enter_;
|
||||
|
@ -338,14 +331,13 @@ static int usb_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val)
|
|||
|
||||
wvalue = (u16)(addr&0x0000ffff);
|
||||
len = 4;
|
||||
data =val;
|
||||
data = cpu_to_le32(val);
|
||||
|
||||
ret =usbctrl_vendorreq(pintfhdl, request, wvalue, index, &data, len, requesttype);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
static int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata)
|
||||
|
|
|
@ -59,169 +59,132 @@ typedef __kernel_ssize_t SSIZE_T;
|
|||
* 3. After read integer from IO.
|
||||
*/
|
||||
|
||||
//
|
||||
// Byte Swapping routine.
|
||||
//
|
||||
#define EF1Byte
|
||||
#define EF2Byte le16_to_cpu
|
||||
#define EF4Byte le32_to_cpu
|
||||
/* Convert little data endian to host ordering */
|
||||
#define EF1BYTE(_val) \
|
||||
((u8)(_val))
|
||||
#define EF2BYTE(_val) \
|
||||
(le16_to_cpu(_val))
|
||||
#define EF4BYTE(_val) \
|
||||
(le32_to_cpu(_val))
|
||||
|
||||
//
|
||||
// Read LE format data from memory
|
||||
//
|
||||
#define ReadEF1Byte(_ptr) EF1Byte(*((u8 *)(_ptr)))
|
||||
#define ReadEF2Byte(_ptr) EF2Byte(*((u16 *)(_ptr)))
|
||||
#define ReadEF4Byte(_ptr) EF4Byte(*((u32 *)(_ptr)))
|
||||
/* Read data from memory */
|
||||
#define READEF1BYTE(_ptr) \
|
||||
EF1BYTE(*((u8 *)(_ptr)))
|
||||
/* Read le16 data from memory and convert to host ordering */
|
||||
#define READEF2BYTE(_ptr) \
|
||||
EF2BYTE(*(_ptr))
|
||||
#define READEF4BYTE(_ptr) \
|
||||
EF4BYTE(*(_ptr))
|
||||
|
||||
//
|
||||
// Write LE data to memory
|
||||
//
|
||||
#define WriteEF1Byte(_ptr, _val) (*((u8 *)(_ptr)))=EF1Byte(_val)
|
||||
#define WriteEF2Byte(_ptr, _val) (*((u16 *)(_ptr)))=EF2Byte(_val)
|
||||
#define WriteEF4Byte(_ptr, _val) (*((u32 *)(_ptr)))=EF4Byte(_val)
|
||||
/* Write data to memory */
|
||||
#define WRITEEF1BYTE(_ptr, _val) \
|
||||
(*((u8 *)(_ptr))) = EF1BYTE(_val)
|
||||
/* Write le data to memory in host ordering */
|
||||
#define WRITEEF2BYTE(_ptr, _val) \
|
||||
(*((u16 *)(_ptr))) = EF2BYTE(_val)
|
||||
#define WRITEEF4BYTE(_ptr, _val) \
|
||||
(*((u32 *)(_ptr))) = EF2BYTE(_val)
|
||||
|
||||
//
|
||||
// Example:
|
||||
// BIT_LEN_MASK_32(0) => 0x00000000
|
||||
// BIT_LEN_MASK_32(1) => 0x00000001
|
||||
// BIT_LEN_MASK_32(2) => 0x00000003
|
||||
// BIT_LEN_MASK_32(32) => 0xFFFFFFFF
|
||||
//
|
||||
#define BIT_LEN_MASK_32(__BitLen) \
|
||||
(0xFFFFFFFF >> (32 - (__BitLen)))
|
||||
//
|
||||
// Example:
|
||||
// BIT_OFFSET_LEN_MASK_32(0, 2) => 0x00000003
|
||||
// BIT_OFFSET_LEN_MASK_32(16, 2) => 0x00030000
|
||||
//
|
||||
#define BIT_OFFSET_LEN_MASK_32(__BitOffset, __BitLen) \
|
||||
(BIT_LEN_MASK_32(__BitLen) << (__BitOffset))
|
||||
/* Create a bit mask
|
||||
* Examples:
|
||||
* BIT_LEN_MASK_32(0) => 0x00000000
|
||||
* BIT_LEN_MASK_32(1) => 0x00000001
|
||||
* BIT_LEN_MASK_32(2) => 0x00000003
|
||||
* BIT_LEN_MASK_32(32) => 0xFFFFFFFF
|
||||
*/
|
||||
#define BIT_LEN_MASK_32(__bitlen) \
|
||||
(0xFFFFFFFF >> (32 - (__bitlen)))
|
||||
#define BIT_LEN_MASK_16(__bitlen) \
|
||||
(0xFFFF >> (16 - (__bitlen)))
|
||||
#define BIT_LEN_MASK_8(__bitlen) \
|
||||
(0xFF >> (8 - (__bitlen)))
|
||||
|
||||
//
|
||||
// Description:
|
||||
// Return 4-byte value in host byte ordering from
|
||||
// 4-byte pointer in litten-endian system.
|
||||
//
|
||||
#define LE_P4BYTE_TO_HOST_4BYTE(__pStart) \
|
||||
(EF4Byte(*((u32 *)(__pStart))))
|
||||
/* Create an offset bit mask
|
||||
* Examples:
|
||||
* BIT_OFFSET_LEN_MASK_32(0, 2) => 0x00000003
|
||||
* BIT_OFFSET_LEN_MASK_32(16, 2) => 0x00030000
|
||||
*/
|
||||
#define BIT_OFFSET_LEN_MASK_32(__bitoffset, __bitlen) \
|
||||
(BIT_LEN_MASK_32(__bitlen) << (__bitoffset))
|
||||
#define BIT_OFFSET_LEN_MASK_16(__bitoffset, __bitlen) \
|
||||
(BIT_LEN_MASK_16(__bitlen) << (__bitoffset))
|
||||
#define BIT_OFFSET_LEN_MASK_8(__bitoffset, __bitlen) \
|
||||
(BIT_LEN_MASK_8(__bitlen) << (__bitoffset))
|
||||
|
||||
//
|
||||
// Description:
|
||||
// Translate subfield (continuous bits in little-endian) of 4-byte value in litten byte to
|
||||
// 4-byte value in host byte ordering.
|
||||
//
|
||||
#define LE_BITS_TO_4BYTE(__pStart, __BitOffset, __BitLen) \
|
||||
/*Description:
|
||||
* Return 4-byte value in host byte ordering from
|
||||
* 4-byte pointer in little-endian system.
|
||||
*/
|
||||
#define LE_P4BYTE_TO_HOST_4BYTE(__pstart) \
|
||||
(EF4BYTE(*((__le32 *)(__pstart))))
|
||||
#define LE_P2BYTE_TO_HOST_2BYTE(__pstart) \
|
||||
(EF2BYTE(*((__le16 *)(__pstart))))
|
||||
#define LE_P1BYTE_TO_HOST_1BYTE(__pstart) \
|
||||
(EF1BYTE(*((u8 *)(__pstart))))
|
||||
|
||||
/*Description:
|
||||
Translate subfield (continuous bits in little-endian) of 4-byte
|
||||
value to host byte ordering.*/
|
||||
#define LE_BITS_TO_4BYTE(__pstart, __bitoffset, __bitlen) \
|
||||
( \
|
||||
( LE_P4BYTE_TO_HOST_4BYTE(__pStart) >> (__BitOffset) ) \
|
||||
& \
|
||||
BIT_LEN_MASK_32(__BitLen) \
|
||||
(LE_P4BYTE_TO_HOST_4BYTE(__pstart) >> (__bitoffset)) & \
|
||||
BIT_LEN_MASK_32(__bitlen) \
|
||||
)
|
||||
#define LE_BITS_TO_2BYTE(__pstart, __bitoffset, __bitlen) \
|
||||
( \
|
||||
(LE_P2BYTE_TO_HOST_2BYTE(__pstart) >> (__bitoffset)) & \
|
||||
BIT_LEN_MASK_16(__bitlen) \
|
||||
)
|
||||
#define LE_BITS_TO_1BYTE(__pstart, __bitoffset, __bitlen) \
|
||||
( \
|
||||
(LE_P1BYTE_TO_HOST_1BYTE(__pstart) >> (__bitoffset)) & \
|
||||
BIT_LEN_MASK_8(__bitlen) \
|
||||
)
|
||||
|
||||
//
|
||||
// Description:
|
||||
// Mask subfield (continuous bits in little-endian) of 4-byte value in litten byte oredering
|
||||
// and return the result in 4-byte value in host byte ordering.
|
||||
//
|
||||
#define LE_BITS_CLEARED_TO_4BYTE(__pStart, __BitOffset, __BitLen) \
|
||||
/* Description:
|
||||
* Mask subfield (continuous bits in little-endian) of 4-byte value
|
||||
* and return the result in 4-byte value in host byte ordering.
|
||||
*/
|
||||
#define LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) \
|
||||
( \
|
||||
LE_P4BYTE_TO_HOST_4BYTE(__pStart) \
|
||||
& \
|
||||
( ~BIT_OFFSET_LEN_MASK_32(__BitOffset, __BitLen) ) \
|
||||
LE_P4BYTE_TO_HOST_4BYTE(__pstart) & \
|
||||
(~BIT_OFFSET_LEN_MASK_32(__bitoffset, __bitlen)) \
|
||||
)
|
||||
#define LE_BITS_CLEARED_TO_2BYTE(__pstart, __bitoffset, __bitlen) \
|
||||
( \
|
||||
LE_P2BYTE_TO_HOST_2BYTE(__pstart) & \
|
||||
(~BIT_OFFSET_LEN_MASK_16(__bitoffset, __bitlen)) \
|
||||
)
|
||||
#define LE_BITS_CLEARED_TO_1BYTE(__pstart, __bitoffset, __bitlen) \
|
||||
( \
|
||||
LE_P1BYTE_TO_HOST_1BYTE(__pstart) & \
|
||||
(~BIT_OFFSET_LEN_MASK_8(__bitoffset, __bitlen)) \
|
||||
)
|
||||
|
||||
//
|
||||
// Description:
|
||||
// Set subfield of little-endian 4-byte value to specified value.
|
||||
//
|
||||
#define SET_BITS_TO_LE_4BYTE(__pStart, __BitOffset, __BitLen, __Value) \
|
||||
*((u32 *)(__pStart)) = \
|
||||
EF4Byte( \
|
||||
LE_BITS_CLEARED_TO_4BYTE(__pStart, __BitOffset, __BitLen) \
|
||||
| \
|
||||
( (((u32)__Value) & BIT_LEN_MASK_32(__BitLen)) << (__BitOffset) ) \
|
||||
);
|
||||
|
||||
|
||||
#define BIT_LEN_MASK_16(__BitLen) \
|
||||
(0xFFFF >> (16 - (__BitLen)))
|
||||
|
||||
#define BIT_OFFSET_LEN_MASK_16(__BitOffset, __BitLen) \
|
||||
(BIT_LEN_MASK_16(__BitLen) << (__BitOffset))
|
||||
|
||||
#define LE_P2BYTE_TO_HOST_2BYTE(__pStart) \
|
||||
(EF2Byte(*((u16 *)(__pStart))))
|
||||
|
||||
#define LE_BITS_TO_2BYTE(__pStart, __BitOffset, __BitLen) \
|
||||
/* Description:
|
||||
* Set subfield of little-endian 4-byte value to specified value.
|
||||
*/
|
||||
#define SET_BITS_TO_LE_4BYTE(__pstart, __bitoffset, __bitlen, __val) \
|
||||
*((u32 *)(__pstart)) = \
|
||||
( \
|
||||
( LE_P2BYTE_TO_HOST_2BYTE(__pStart) >> (__BitOffset) ) \
|
||||
& \
|
||||
BIT_LEN_MASK_16(__BitLen) \
|
||||
)
|
||||
|
||||
#define LE_BITS_CLEARED_TO_2BYTE(__pStart, __BitOffset, __BitLen) \
|
||||
LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) | \
|
||||
((((u32)__val) & BIT_LEN_MASK_32(__bitlen)) << (__bitoffset)) \
|
||||
);
|
||||
#define SET_BITS_TO_LE_2BYTE(__pstart, __bitoffset, __bitlen, __val) \
|
||||
*((u16 *)(__pstart)) = \
|
||||
( \
|
||||
LE_P2BYTE_TO_HOST_2BYTE(__pStart) \
|
||||
& \
|
||||
( ~BIT_OFFSET_LEN_MASK_16(__BitOffset, __BitLen) ) \
|
||||
)
|
||||
|
||||
#define SET_BITS_TO_LE_2BYTE(__pStart, __BitOffset, __BitLen, __Value) \
|
||||
*((u16 *)(__pStart)) = \
|
||||
EF2Byte( \
|
||||
LE_BITS_CLEARED_TO_2BYTE(__pStart, __BitOffset, __BitLen) \
|
||||
| \
|
||||
( (((u16)__Value) & BIT_LEN_MASK_16(__BitLen)) << (__BitOffset) ) \
|
||||
);
|
||||
|
||||
#define BIT_LEN_MASK_8(__BitLen) \
|
||||
(0xFF >> (8 - (__BitLen)))
|
||||
|
||||
#define BIT_OFFSET_LEN_MASK_8(__BitOffset, __BitLen) \
|
||||
(BIT_LEN_MASK_8(__BitLen) << (__BitOffset))
|
||||
|
||||
#define LE_P1BYTE_TO_HOST_1BYTE(__pStart) \
|
||||
(EF1Byte(*((u8 *)(__pStart))))
|
||||
|
||||
#define LE_BITS_TO_1BYTE(__pStart, __BitOffset, __BitLen) \
|
||||
LE_BITS_CLEARED_TO_2BYTE(__pstart, __bitoffset, __bitlen) | \
|
||||
((((u16)__val) & BIT_LEN_MASK_16(__bitlen)) << (__bitoffset)) \
|
||||
);
|
||||
#define SET_BITS_TO_LE_1BYTE(__pstart, __bitoffset, __bitlen, __val) \
|
||||
*((u8 *)(__pstart)) = EF1BYTE \
|
||||
( \
|
||||
( LE_P1BYTE_TO_HOST_1BYTE(__pStart) >> (__BitOffset) ) \
|
||||
& \
|
||||
BIT_LEN_MASK_8(__BitLen) \
|
||||
)
|
||||
LE_BITS_CLEARED_TO_1BYTE(__pstart, __bitoffset, __bitlen) | \
|
||||
((((u8)__val) & BIT_LEN_MASK_8(__bitlen)) << (__bitoffset)) \
|
||||
);
|
||||
|
||||
#define LE_BITS_CLEARED_TO_1BYTE(__pStart, __BitOffset, __BitLen) \
|
||||
( \
|
||||
LE_P1BYTE_TO_HOST_1BYTE(__pStart) \
|
||||
& \
|
||||
( ~BIT_OFFSET_LEN_MASK_8(__BitOffset, __BitLen) ) \
|
||||
)
|
||||
|
||||
#define SET_BITS_TO_LE_1BYTE(__pStart, __BitOffset, __BitLen, __Value) \
|
||||
*((u8 *)(__pStart)) = \
|
||||
EF1Byte( \
|
||||
LE_BITS_CLEARED_TO_1BYTE(__pStart, __BitOffset, __BitLen) \
|
||||
| \
|
||||
( (((u8)__Value) & BIT_LEN_MASK_8(__BitLen)) << (__BitOffset) ) \
|
||||
);
|
||||
|
||||
//pclint
|
||||
#define LE_BITS_CLEARED_TO_1BYTE_8BIT(__pStart, __BitOffset, __BitLen) \
|
||||
( \
|
||||
LE_P1BYTE_TO_HOST_1BYTE(__pStart) \
|
||||
)
|
||||
|
||||
//pclint
|
||||
#define SET_BITS_TO_LE_1BYTE_8BIT(__pStart, __BitOffset, __BitLen, __Value) \
|
||||
{ \
|
||||
*((pu1Byte)(__pStart)) = \
|
||||
EF1Byte( \
|
||||
LE_BITS_CLEARED_TO_1BYTE_8BIT(__pStart, __BitOffset, __BitLen) \
|
||||
| \
|
||||
((u1Byte)__Value) \
|
||||
); \
|
||||
}
|
||||
|
||||
// Get the N-bytes aligment offset from the current length
|
||||
#define N_BYTE_ALIGMENT(__Value, __Aligment) ((__Aligment == 1) ? (__Value) : (((__Value + __Aligment - 1) / __Aligment) * __Aligment))
|
||||
/* Get the N-bytes aligment offset from the current length */
|
||||
#define N_BYTE_ALIGMENT(__value, __aligment) ((__aligment == 1) ? \
|
||||
(__value) : (((__value + __aligment - 1) / __aligment) * __aligment))
|
||||
|
||||
#endif //__BASIC_TYPES_H__
|
||||
|
|
|
@ -218,8 +218,8 @@ struct hal_ops {
|
|||
|
||||
u32 (*read_bbreg)(_adapter *padapter, u32 RegAddr, u32 BitMask);
|
||||
void (*write_bbreg)(_adapter *padapter, u32 RegAddr, u32 BitMask, u32 Data);
|
||||
u32 (*read_rfreg)(_adapter *padapter, u32 eRFPath, u32 RegAddr, u32 BitMask);
|
||||
void (*write_rfreg)(_adapter *padapter, u32 eRFPath, u32 RegAddr, u32 BitMask, u32 Data);
|
||||
u32 (*read_rfreg)(_adapter *padapter, RF_RADIO_PATH_E eRFPath, u32 RegAddr, u32 BitMask);
|
||||
void (*write_rfreg)(_adapter *padapter, RF_RADIO_PATH_E eRFPath, u32 RegAddr, u32 BitMask, u32 Data);
|
||||
|
||||
#ifdef CONFIG_HOSTAPD_MLME
|
||||
s32 (*hostap_mgnt_xmit_entry)(_adapter *padapter, _pkt *pkt);
|
||||
|
|
|
@ -595,8 +595,8 @@ extern int ATOMIC_DEC_RETURN(ATOMIC_T *v);
|
|||
|
||||
//File operation APIs, just for linux now
|
||||
extern int rtw_is_file_readable(char *path);
|
||||
extern int rtw_retrive_from_file(char *path, u8* buf, u32 sz);
|
||||
extern int rtw_store_to_file(char *path, u8* buf, u32 sz);
|
||||
extern int rtw_retrive_from_file(char *path, u8 __user *buf, u32 sz);
|
||||
extern int rtw_store_to_file(char *path, u8 __user *buf, u32 sz);
|
||||
|
||||
struct rtw_netdev_priv_indicator {
|
||||
void *priv;
|
||||
|
|
|
@ -134,7 +134,7 @@ void rtl8188e_set_p2p_ps_offload_cmd(PADAPTER padapter, u8 p2p_ps_state);
|
|||
#endif //CONFIG_P2P
|
||||
|
||||
void CheckFwRsvdPageContent(PADAPTER padapter);
|
||||
void rtl8188e_set_FwMediaStatus_cmd(PADAPTER padapter, u16 mstatus_rpt );
|
||||
void rtl8188e_set_FwMediaStatus_cmd(PADAPTER padapter, __le16 mstatus_rpt);
|
||||
|
||||
#ifdef CONFIG_TSF_RESET_OFFLOAD
|
||||
//u8 rtl8188e_reset_tsf(_adapter *padapter, u8 reset_port);
|
||||
|
|
|
@ -180,10 +180,10 @@ typedef struct _RT_8188E_FIRMWARE_HDR
|
|||
// 8-byte alinment required
|
||||
|
||||
//--- LONG WORD 0 ----
|
||||
u16 Signature; // 92C0: test chip; 92C, 88C0: test chip; 88C1: MP A-cut; 92C1: MP A-cut
|
||||
__le16 Signature; // 92C0: test chip; 92C, 88C0: test chip; 88C1: MP A-cut; 92C1: MP A-cut
|
||||
u8 Category; // AP/NIC and USB/PCI
|
||||
u8 Function; // Reserved for different FW function indcation, for further use when driver needs to download different FW in different conditions
|
||||
u16 Version; // FW Version
|
||||
__le16 Version; // FW Version
|
||||
u8 Subversion; // FW Subversion, default 0x00
|
||||
u16 Rsvd1;
|
||||
|
||||
|
|
|
@ -134,17 +134,17 @@ struct io_queue;
|
|||
|
||||
struct _io_ops {
|
||||
u8 (*_read8)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
__le16 (*_read16)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
__le32 (*_read32)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
u16 (*_read16)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
u32 (*_read32)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
|
||||
int (*_write8)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
|
||||
int (*_write16)(struct intf_hdl *pintfhdl, u32 addr, __le16 val);
|
||||
int (*_write32)(struct intf_hdl *pintfhdl, u32 addr, __le32 val);
|
||||
int (*_write16)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
|
||||
int (*_write32)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
|
||||
int (*_writeN)(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata);
|
||||
|
||||
int (*_write8_async)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
|
||||
int (*_write16_async)(struct intf_hdl *pintfhdl, u32 addr, __le16 val);
|
||||
int (*_write32_async)(struct intf_hdl *pintfhdl, u32 addr, __le32 val);
|
||||
int (*_write16_async)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
|
||||
int (*_write32_async)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
|
||||
|
||||
void (*_read_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
|
||||
void (*_write_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
|
||||
|
|
|
@ -39,9 +39,9 @@ int rtw_IOL_append_END_cmd(struct xmit_frame *xmit_frame);
|
|||
struct ioreg_cfg{
|
||||
u8 length;
|
||||
u8 cmd_id;
|
||||
u16 address;
|
||||
u32 data;
|
||||
u32 mask;
|
||||
__le16 address;
|
||||
__le32 data;
|
||||
__le32 mask;
|
||||
};
|
||||
enum ioreg_cmd{
|
||||
IOREG_CMD_LLT = 0x01,
|
||||
|
|
|
@ -189,25 +189,13 @@ struct rx_pkt_attrib {
|
|||
#define RXDESC_SIZE 24
|
||||
#define RXDESC_OFFSET RXDESC_SIZE
|
||||
|
||||
struct recv_stat
|
||||
{
|
||||
unsigned int rxdw0;
|
||||
|
||||
unsigned int rxdw1;
|
||||
|
||||
unsigned int rxdw2;
|
||||
|
||||
unsigned int rxdw3;
|
||||
|
||||
unsigned int rxdw4;
|
||||
|
||||
unsigned int rxdw5;
|
||||
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
unsigned int rxdw6;
|
||||
|
||||
unsigned int rxdw7;
|
||||
#endif
|
||||
struct recv_stat {
|
||||
__le32 rxdw0;
|
||||
__le32 rxdw1;
|
||||
__le32 rxdw2;
|
||||
__le32 rxdw3;
|
||||
__le32 rxdw4;
|
||||
__le32 rxdw5;
|
||||
};
|
||||
|
||||
#define EOR BIT(30)
|
||||
|
|
|
@ -488,7 +488,7 @@ static int closeFile(struct file *fp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int readFile(struct file *fp,char *buf,int len)
|
||||
static int readFile(struct file *fp,char __user *buf,int len)
|
||||
{
|
||||
int rlen=0, sum=0;
|
||||
|
||||
|
@ -509,7 +509,7 @@ static int readFile(struct file *fp,char *buf,int len)
|
|||
|
||||
}
|
||||
|
||||
static int writeFile(struct file *fp,char *buf,int len)
|
||||
static int writeFile(struct file *fp, char __user *buf, int len)
|
||||
{
|
||||
int wlen=0, sum=0;
|
||||
|
||||
|
@ -540,7 +540,7 @@ static int isFileReadable(char *path)
|
|||
struct file *fp;
|
||||
int ret = 0;
|
||||
mm_segment_t oldfs;
|
||||
char buf;
|
||||
char __user buf;
|
||||
|
||||
fp=filp_open(path, O_RDONLY, 0);
|
||||
if (IS_ERR(fp)) {
|
||||
|
@ -565,7 +565,7 @@ static int isFileReadable(char *path)
|
|||
* @param sz how many bytes to read at most
|
||||
* @return the byte we've read, or Linux specific error code
|
||||
*/
|
||||
static int retriveFromFile(char *path, u8* buf, u32 sz)
|
||||
static int retriveFromFile(char *path, u8 __user *buf, u32 sz)
|
||||
{
|
||||
int ret =-1;
|
||||
mm_segment_t oldfs;
|
||||
|
@ -599,7 +599,7 @@ static int retriveFromFile(char *path, u8* buf, u32 sz)
|
|||
* @param sz how many bytes to write at most
|
||||
* @return the byte we've written, or Linux specific error code
|
||||
*/
|
||||
static int storeToFile(char *path, u8* buf, u32 sz)
|
||||
static int storeToFile(char *path, u8 __user *buf, u32 sz)
|
||||
{
|
||||
int ret =0;
|
||||
mm_segment_t oldfs;
|
||||
|
@ -646,7 +646,7 @@ int rtw_is_file_readable(char *path)
|
|||
* @param sz how many bytes to read at most
|
||||
* @return the byte we've read
|
||||
*/
|
||||
int rtw_retrive_from_file(char *path, u8* buf, u32 sz)
|
||||
int rtw_retrive_from_file(char *path, u8 __user *buf, u32 sz)
|
||||
{
|
||||
int ret =retriveFromFile(path, buf, sz);
|
||||
return ret>=0?ret:0;
|
||||
|
@ -659,10 +659,10 @@ int rtw_retrive_from_file(char *path, u8* buf, u32 sz)
|
|||
* @param sz how many bytes to write at most
|
||||
* @return the byte we've written
|
||||
*/
|
||||
int rtw_store_to_file(char *path, u8* buf, u32 sz)
|
||||
int rtw_store_to_file(char *path, u8 __user *buf, u32 sz)
|
||||
{
|
||||
int ret =storeToFile(path, buf, sz);
|
||||
return ret>=0?ret:0;
|
||||
return ret >= 0 ? ret : 0;
|
||||
}
|
||||
|
||||
struct net_device *rtw_alloc_etherdev_with_old_priv(int sizeof_priv, void *old_priv)
|
||||
|
|
Loading…
Reference in a new issue