u16 _rtw_read1623a(struct rtw_adapter *adapter, u32 addr)
{
- u16 r_val;
struct _io_ops *io_ops = &adapter->io_ops;
- r_val = io_ops->_read16(adapter, addr);
-
- return le16_to_cpu(r_val);
+ return io_ops->_read16(adapter, addr);
}
u32 _rtw_read3223a(struct rtw_adapter *adapter, u32 addr)
{
- u32 r_val;
struct _io_ops *io_ops = &adapter->io_ops;
- r_val = io_ops->_read32(adapter, addr);
-
- return le32_to_cpu(r_val);
+ return io_ops->_read32(adapter, addr);
}
int _rtw_write823a(struct rtw_adapter *adapter, u32 addr, u8 val)
struct _io_ops *io_ops = &adapter->io_ops;
int ret;
- val = cpu_to_le16(val);
ret = io_ops->_write16(adapter, addr, val);
return RTW_STATUS_CODE23a(ret);
struct _io_ops *io_ops = &adapter->io_ops;
int ret;
- val = cpu_to_le32(val);
ret = io_ops->_write32(adapter, addr, val);
return RTW_STATUS_CODE23a(ret);
u16 wvalue;
u16 index;
u16 len;
- u16 data = 0;
+ __le16 data;
request = 0x05;
requesttype = 0x01;/* read_in */
usbctrl_vendorreq(padapter, request, wvalue, index, &data,
len, requesttype);
- return data;
+ return le16_to_cpu(data);
}
static u32 usb_read32(struct rtw_adapter *padapter, u32 addr)
u16 wvalue;
u16 index;
u16 len;
- u32 data = 0;
+ __le32 data;
request = 0x05;
requesttype = 0x01;/* read_in */
usbctrl_vendorreq(padapter, request, wvalue, index, &data,
len, requesttype);
- return data;
+ return le32_to_cpu(data);
}
static int usb_write8(struct rtw_adapter *padapter, u32 addr, u8 val)
u16 wvalue;
u16 index;
u16 len;
- u16 data;
+ __le16 data;
int ret;
request = 0x05;
wvalue = (u16)(addr&0x0000ffff);
len = 2;
- data = val;
+ data = cpu_to_le16(val);
ret = usbctrl_vendorreq(padapter, request, wvalue, index, &data,
len, requesttype);
u16 wvalue;
u16 index;
u16 len;
- u32 data;
+ __le32 data;
int ret;
request = 0x05;
wvalue = (u16)(addr&0x0000ffff);
len = 4;
- data = val;
+ data = cpu_to_le32(val);
ret = usbctrl_vendorreq(padapter, request, wvalue, index, &data,
len, requesttype);