mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-09 14:53:05 +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
|
@ -28,6 +28,7 @@
|
|||
#include <circ_buf.h>
|
||||
#include <ip.h>
|
||||
#include <usb_ops.h>
|
||||
#include "rtw_br_ext.h"
|
||||
|
||||
static u8 P802_1H_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0xf8 };
|
||||
static u8 RFC1042_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0x00 };
|
||||
|
@ -1126,7 +1127,7 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat
|
|||
#endif //CONFIG_TDLS
|
||||
|
||||
sint res = _SUCCESS;
|
||||
u16 *fctrl = &pwlanhdr->frame_ctl;
|
||||
__le16 *fctrl = &pwlanhdr->frame_ctl;
|
||||
|
||||
struct sta_info *psta;
|
||||
|
||||
|
@ -2167,10 +2168,7 @@ s32 rtw_put_snap(u8 *data, u16 h_proto)
|
|||
snap->oui[1] = oui[1];
|
||||
snap->oui[2] = oui[2];
|
||||
|
||||
*(u16 *)(data + SNAP_SIZE) = htons(h_proto);
|
||||
|
||||
;
|
||||
|
||||
*(__be16 *)(data + SNAP_SIZE) = htons(h_proto);
|
||||
return SNAP_SIZE + sizeof(u16);
|
||||
}
|
||||
|
||||
|
@ -2430,7 +2428,7 @@ s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)
|
|||
return _SUCCESS;
|
||||
}
|
||||
|
||||
void rtw_init_xmitframe(struct xmit_frame *pxframe)
|
||||
static void rtw_init_xmitframe(struct xmit_frame *pxframe)
|
||||
{
|
||||
if (pxframe != NULL)//default value setting
|
||||
{
|
||||
|
@ -2980,7 +2978,7 @@ void rtw_init_hwxmits(struct hw_xmit *phwxmit, sint entry)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_BR_EXT
|
||||
int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
|
||||
static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
|
||||
{
|
||||
struct sk_buff *skb = *pskb;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
|
@ -3005,8 +3003,8 @@ int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
|
|||
if ( !(skb->data[0] & 1) &&
|
||||
br_port &&
|
||||
memcmp(skb->data+MACADDRLEN, padapter->br_mac, MACADDRLEN) &&
|
||||
*((unsigned short *)(skb->data+MACADDRLEN*2)) != __constant_htons(ETH_P_8021Q) &&
|
||||
*((unsigned short *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_IP) &&
|
||||
*((__be16 *)(skb->data+MACADDRLEN*2)) != __constant_htons(ETH_P_8021Q) &&
|
||||
*((__be16 *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_IP) &&
|
||||
!memcmp(padapter->scdb_mac, skb->data+MACADDRLEN, MACADDRLEN) && padapter->scdb_entry) {
|
||||
memcpy(skb->data+MACADDRLEN, GET_MY_HWADDR(padapter), MACADDRLEN);
|
||||
padapter->scdb_entry->ageing_timer = jiffies;
|
||||
|
@ -3018,7 +3016,7 @@ int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
|
|||
// if (priv->dev->br_port &&
|
||||
// !memcmp(skb->data+MACADDRLEN, priv->br_mac, MACADDRLEN)) {
|
||||
#if 1
|
||||
if (*((unsigned short *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_8021Q)) {
|
||||
if (*((__be16 *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_8021Q)) {
|
||||
is_vlan_tag = 1;
|
||||
vlan_hdr = *((unsigned short *)(skb->data+MACADDRLEN*2+2));
|
||||
for (i=0; i<6; i++)
|
||||
|
@ -3027,13 +3025,11 @@ int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
|
|||
}
|
||||
//if SA == br_mac && skb== IP => copy SIP to br_ip ?? why
|
||||
if (!memcmp(skb->data+MACADDRLEN, padapter->br_mac, MACADDRLEN) &&
|
||||
(*((unsigned short *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_IP)))
|
||||
(*((__be16 *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_IP)))
|
||||
memcpy(padapter->br_ip, skb->data+WLAN_ETHHDR_LEN+12, 4);
|
||||
|
||||
if (*((unsigned short *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_IP)) {
|
||||
if (*((__be16 *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_IP)) {
|
||||
if (memcmp(padapter->scdb_mac, skb->data+MACADDRLEN, MACADDRLEN)) {
|
||||
void *scdb_findEntry(struct adapter *priv, unsigned char *macAddr, unsigned char *ipAddr);
|
||||
|
||||
if ((padapter->scdb_entry = (struct nat25_network_db_entry *)scdb_findEntry(padapter,
|
||||
skb->data+MACADDRLEN, skb->data+WLAN_ETHHDR_LEN+12)) != NULL) {
|
||||
memcpy(padapter->scdb_mac, skb->data+MACADDRLEN, MACADDRLEN);
|
||||
|
@ -3065,7 +3061,7 @@ int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
|
|||
skb_push(skb, 4);
|
||||
for (i=0; i<6; i++)
|
||||
*((unsigned short *)(skb->data+i*2)) = *((unsigned short *)(skb->data+4+i*2));
|
||||
*((unsigned short *)(skb->data+MACADDRLEN*2)) = __constant_htons(ETH_P_8021Q);
|
||||
*((__be16 *)(skb->data+MACADDRLEN*2)) = __constant_htons(ETH_P_8021Q);
|
||||
*((unsigned short *)(skb->data+MACADDRLEN*2+2)) = vlan_hdr;
|
||||
}
|
||||
|
||||
|
@ -3126,7 +3122,7 @@ int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
|
|||
skb_push(skb, 4);
|
||||
for (i=0; i<6; i++)
|
||||
*((unsigned short *)(skb->data+i*2)) = *((unsigned short *)(skb->data+4+i*2));
|
||||
*((unsigned short *)(skb->data+MACADDRLEN*2)) = __constant_htons(ETH_P_8021Q);
|
||||
*((__be16 *)(skb->data+MACADDRLEN*2)) = __constant_htons(ETH_P_8021Q);
|
||||
*((unsigned short *)(skb->data+MACADDRLEN*2+2)) = vlan_hdr;
|
||||
}
|
||||
}
|
||||
|
@ -4090,7 +4086,7 @@ int rtw_sctx_wait(struct submit_ctx *sctx)
|
|||
return ret;
|
||||
}
|
||||
|
||||
bool rtw_sctx_chk_waring_status(int status)
|
||||
static bool rtw_sctx_chk_waring_status(int status)
|
||||
{
|
||||
switch(status) {
|
||||
case RTW_SCTX_DONE_UNKNOWN:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue