Commit 17c9ac62 authored by Larry Finger's avatar Larry Finger Committed by John W. Linville

rtlwifi: rtl8192ce: Fix endian warnings

Drivers rtlwifi, and rtl8192ce generate a large number of
sparse warnings. This patch fixes most of them.
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 663dcc73
...@@ -144,7 +144,7 @@ static void _rtl_init_hw_ht_capab(struct ieee80211_hw *hw, ...@@ -144,7 +144,7 @@ static void _rtl_init_hw_ht_capab(struct ieee80211_hw *hw,
ht_cap->mcs.rx_mask[1] = 0xFF; ht_cap->mcs.rx_mask[1] = 0xFF;
ht_cap->mcs.rx_mask[4] = 0x01; ht_cap->mcs.rx_mask[4] = 0x01;
ht_cap->mcs.rx_highest = MAX_BIT_RATE_40MHZ_MCS15; ht_cap->mcs.rx_highest = cpu_to_le16(MAX_BIT_RATE_40MHZ_MCS15);
} else if (get_rf_type(rtlphy) == RF_1T1R) { } else if (get_rf_type(rtlphy) == RF_1T1R) {
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("1T1R\n")); RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("1T1R\n"));
...@@ -153,7 +153,7 @@ static void _rtl_init_hw_ht_capab(struct ieee80211_hw *hw, ...@@ -153,7 +153,7 @@ static void _rtl_init_hw_ht_capab(struct ieee80211_hw *hw,
ht_cap->mcs.rx_mask[1] = 0x00; ht_cap->mcs.rx_mask[1] = 0x00;
ht_cap->mcs.rx_mask[4] = 0x01; ht_cap->mcs.rx_mask[4] = 0x01;
ht_cap->mcs.rx_highest = MAX_BIT_RATE_40MHZ_MCS7; ht_cap->mcs.rx_highest = cpu_to_le16(MAX_BIT_RATE_40MHZ_MCS7);
} }
} }
...@@ -498,7 +498,7 @@ void rtl_get_tcb_desc(struct ieee80211_hw *hw, ...@@ -498,7 +498,7 @@ void rtl_get_tcb_desc(struct ieee80211_hw *hw,
struct rtl_mac *rtlmac = rtl_mac(rtl_priv(hw)); struct rtl_mac *rtlmac = rtl_mac(rtl_priv(hw));
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data); struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data);
struct ieee80211_rate *txrate; struct ieee80211_rate *txrate;
u16 fc = le16_to_cpu(hdr->frame_control); __le16 fc = hdr->frame_control;
memset(tcb_desc, 0, sizeof(struct rtl_tcb_desc)); memset(tcb_desc, 0, sizeof(struct rtl_tcb_desc));
...@@ -570,7 +570,7 @@ bool rtl_tx_mgmt_proc(struct ieee80211_hw *hw, struct sk_buff *skb) ...@@ -570,7 +570,7 @@ bool rtl_tx_mgmt_proc(struct ieee80211_hw *hw, struct sk_buff *skb)
struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data); struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data);
u16 fc = le16_to_cpu(hdr->frame_control); __le16 fc = hdr->frame_control;
if (ieee80211_is_auth(fc)) { if (ieee80211_is_auth(fc)) {
RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, ("MAC80211_LINKING\n")); RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, ("MAC80211_LINKING\n"));
...@@ -587,7 +587,7 @@ bool rtl_action_proc(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx) ...@@ -587,7 +587,7 @@ bool rtl_action_proc(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data); struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data);
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
u16 fc = le16_to_cpu(hdr->frame_control); __le16 fc = hdr->frame_control;
u8 *act = (u8 *) (((u8 *) skb->data + MAC80211_3ADDR_LEN)); u8 *act = (u8 *) (((u8 *) skb->data + MAC80211_3ADDR_LEN));
u8 category; u8 category;
...@@ -632,7 +632,7 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx) ...@@ -632,7 +632,7 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data); struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data);
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
u16 fc = le16_to_cpu(hdr->frame_control); __le16 fc = hdr->frame_control;
u16 ether_type; u16 ether_type;
u8 mac_hdr_len = ieee80211_get_hdrlen_from_skb(skb); u8 mac_hdr_len = ieee80211_get_hdrlen_from_skb(skb);
const struct iphdr *ip; const struct iphdr *ip;
...@@ -646,7 +646,6 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx) ...@@ -646,7 +646,6 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
ip = (struct iphdr *)((u8 *) skb->data + mac_hdr_len + ip = (struct iphdr *)((u8 *) skb->data + mac_hdr_len +
SNAP_SIZE + PROTOC_TYPE_SIZE); SNAP_SIZE + PROTOC_TYPE_SIZE);
ether_type = *(u16 *) ((u8 *) skb->data + mac_hdr_len + SNAP_SIZE); ether_type = *(u16 *) ((u8 *) skb->data + mac_hdr_len + SNAP_SIZE);
ether_type = ntohs(ether_type);
if (ETH_P_IP == ether_type) { if (ETH_P_IP == ether_type) {
if (IPPROTO_UDP == ip->protocol) { if (IPPROTO_UDP == ip->protocol) {
...@@ -690,7 +689,8 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx) ...@@ -690,7 +689,8 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
} }
return true; return true;
} else if (0x86DD == ether_type) { } else if (ETH_P_IPV6 == ether_type) {
/* IPv6 */
return true; return true;
} }
......
...@@ -434,9 +434,9 @@ static int rtl_op_conf_tx(struct ieee80211_hw *hw, u16 queue, ...@@ -434,9 +434,9 @@ static int rtl_op_conf_tx(struct ieee80211_hw *hw, u16 queue,
aci = _rtl_get_hal_qnum(queue); aci = _rtl_get_hal_qnum(queue);
mac->ac[aci].aifs = param->aifs; mac->ac[aci].aifs = param->aifs;
mac->ac[aci].cw_min = param->cw_min; mac->ac[aci].cw_min = cpu_to_le16(param->cw_min);
mac->ac[aci].cw_max = param->cw_max; mac->ac[aci].cw_max = cpu_to_le16(param->cw_max);
mac->ac[aci].tx_op = param->txop; mac->ac[aci].tx_op = cpu_to_le16(param->txop);
memcpy(&mac->edca_param[aci], param, sizeof(*param)); memcpy(&mac->edca_param[aci], param, sizeof(*param));
rtlpriv->cfg->ops->set_qos(hw, aci); rtlpriv->cfg->ops->set_qos(hw, aci);
return 0; return 0;
......
...@@ -476,9 +476,9 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio) ...@@ -476,9 +476,9 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio)
skb = __skb_dequeue(&ring->queue); skb = __skb_dequeue(&ring->queue);
pci_unmap_single(rtlpci->pdev, pci_unmap_single(rtlpci->pdev,
le32_to_cpu(rtlpriv->cfg->ops-> rtlpriv->cfg->ops->
get_desc((u8 *) entry, true, get_desc((u8 *) entry, true,
HW_DESC_TXBUFF_ADDR)), HW_DESC_TXBUFF_ADDR),
skb->len, PCI_DMA_TODEVICE); skb->len, PCI_DMA_TODEVICE);
RT_TRACE(rtlpriv, (COMP_INTR | COMP_SEND), DBG_TRACE, RT_TRACE(rtlpriv, (COMP_INTR | COMP_SEND), DBG_TRACE,
...@@ -557,7 +557,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -557,7 +557,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
return; return;
} else { } else {
struct ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
u16 fc; __le16 fc;
struct sk_buff *new_skb = NULL; struct sk_buff *new_skb = NULL;
rtlpriv->cfg->ops->query_rx_desc(hw, &stats, rtlpriv->cfg->ops->query_rx_desc(hw, &stats,
...@@ -583,7 +583,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -583,7 +583,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
*/ */
hdr = (struct ieee80211_hdr *)(skb->data); hdr = (struct ieee80211_hdr *)(skb->data);
fc = le16_to_cpu(hdr->frame_control); fc = hdr->frame_control;
if (!stats.crc) { if (!stats.crc) {
memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, memcpy(IEEE80211_SKB_RXCB(skb), &rx_status,
...@@ -666,7 +666,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -666,7 +666,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
} }
done: done:
bufferaddress = cpu_to_le32(*((dma_addr_t *) skb->cb)); bufferaddress = (u32)(*((dma_addr_t *) skb->cb));
tmp_one = 1; tmp_one = 1;
rtlpriv->cfg->ops->set_desc((u8 *) pdesc, false, rtlpriv->cfg->ops->set_desc((u8 *) pdesc, false,
HW_DESC_RXBUFF_ADDR, HW_DESC_RXBUFF_ADDR,
...@@ -955,9 +955,8 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw, ...@@ -955,9 +955,8 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw,
("queue:%d, ring_addr:%p\n", prio, ring)); ("queue:%d, ring_addr:%p\n", prio, ring));
for (i = 0; i < entries; i++) { for (i = 0; i < entries; i++) {
nextdescaddress = cpu_to_le32((u32) dma + nextdescaddress = (u32) dma + ((i + 1) % entries) *
((i + 1) % entries) * sizeof(*ring);
sizeof(*ring));
rtlpriv->cfg->ops->set_desc((u8 *)&(ring[i]), rtlpriv->cfg->ops->set_desc((u8 *)&(ring[i]),
true, HW_DESC_TX_NEXTDESC_ADDR, true, HW_DESC_TX_NEXTDESC_ADDR,
...@@ -1021,7 +1020,7 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw) ...@@ -1021,7 +1020,7 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw)
rtlpci->rxbuffersize, rtlpci->rxbuffersize,
PCI_DMA_FROMDEVICE); PCI_DMA_FROMDEVICE);
bufferaddress = cpu_to_le32(*((dma_addr_t *)skb->cb)); bufferaddress = (u32)(*((dma_addr_t *)skb->cb));
rtlpriv->cfg->ops->set_desc((u8 *)entry, false, rtlpriv->cfg->ops->set_desc((u8 *)entry, false,
HW_DESC_RXBUFF_ADDR, HW_DESC_RXBUFF_ADDR,
(u8 *)&bufferaddress); (u8 *)&bufferaddress);
...@@ -1052,9 +1051,9 @@ static void _rtl_pci_free_tx_ring(struct ieee80211_hw *hw, ...@@ -1052,9 +1051,9 @@ static void _rtl_pci_free_tx_ring(struct ieee80211_hw *hw,
struct sk_buff *skb = __skb_dequeue(&ring->queue); struct sk_buff *skb = __skb_dequeue(&ring->queue);
pci_unmap_single(rtlpci->pdev, pci_unmap_single(rtlpci->pdev,
le32_to_cpu(rtlpriv->cfg-> rtlpriv->cfg->
ops->get_desc((u8 *) entry, true, ops->get_desc((u8 *) entry, true,
HW_DESC_TXBUFF_ADDR)), HW_DESC_TXBUFF_ADDR),
skb->len, PCI_DMA_TODEVICE); skb->len, PCI_DMA_TODEVICE);
kfree_skb(skb); kfree_skb(skb);
ring->idx = (ring->idx + 1) % ring->entries; ring->idx = (ring->idx + 1) % ring->entries;
...@@ -1186,11 +1185,11 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw) ...@@ -1186,11 +1185,11 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw)
__skb_dequeue(&ring->queue); __skb_dequeue(&ring->queue);
pci_unmap_single(rtlpci->pdev, pci_unmap_single(rtlpci->pdev,
le32_to_cpu(rtlpriv->cfg->ops-> rtlpriv->cfg->ops->
get_desc((u8 *) get_desc((u8 *)
entry, entry,
true, true,
HW_DESC_TXBUFF_ADDR)), HW_DESC_TXBUFF_ADDR),
skb->len, PCI_DMA_TODEVICE); skb->len, PCI_DMA_TODEVICE);
kfree_skb(skb); kfree_skb(skb);
ring->idx = (ring->idx + 1) % ring->entries; ring->idx = (ring->idx + 1) % ring->entries;
...@@ -1204,7 +1203,7 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw) ...@@ -1204,7 +1203,7 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw)
return 0; return 0;
} }
static unsigned int _rtl_mac_to_hwqueue(u16 fc, static unsigned int _rtl_mac_to_hwqueue(__le16 fc,
unsigned int mac80211_queue_index) unsigned int mac80211_queue_index)
{ {
unsigned int hw_queue_index; unsigned int hw_queue_index;
...@@ -1254,7 +1253,7 @@ static int rtl_pci_tx(struct ieee80211_hw *hw, struct sk_buff *skb) ...@@ -1254,7 +1253,7 @@ static int rtl_pci_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
unsigned int queue_index, hw_queue; unsigned int queue_index, hw_queue;
unsigned long flags; unsigned long flags;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data); struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data);
u16 fc = le16_to_cpu(hdr->frame_control); __le16 fc = hdr->frame_control;
u8 *pda_addr = hdr->addr1; u8 *pda_addr = hdr->addr1;
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
/*ssn */ /*ssn */
......
...@@ -318,15 +318,17 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) ...@@ -318,15 +318,17 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
} }
case HW_VAR_AC_PARAM:{ case HW_VAR_AC_PARAM:{
u8 e_aci = *((u8 *) val); u8 e_aci = *((u8 *) val);
u32 u4b_ac_param = 0; u32 u4b_ac_param;
u16 cw_min = le16_to_cpu(mac->ac[e_aci].cw_min);
u16 cw_max = le16_to_cpu(mac->ac[e_aci].cw_max);
u16 tx_op = le16_to_cpu(mac->ac[e_aci].tx_op);
u4b_ac_param |= (u32) mac->ac[e_aci].aifs; u4b_ac_param = (u32) mac->ac[e_aci].aifs;
u4b_ac_param |= ((u32) mac->ac[e_aci].cw_min u4b_ac_param |= ((u32)cw_min
& 0xF) << AC_PARAM_ECW_MIN_OFFSET; & 0xF) << AC_PARAM_ECW_MIN_OFFSET;
u4b_ac_param |= ((u32) mac->ac[e_aci].cw_max & u4b_ac_param |= ((u32)cw_max &
0xF) << AC_PARAM_ECW_MAX_OFFSET; 0xF) << AC_PARAM_ECW_MAX_OFFSET;
u4b_ac_param |= (u32) mac->ac[e_aci].tx_op u4b_ac_param |= (u32)tx_op << AC_PARAM_TXOP_OFFSET;
<< AC_PARAM_TXOP_LIMIT_OFFSET;
RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
("queue:%x, ac_param:%x\n", e_aci, ("queue:%x, ac_param:%x\n", e_aci,
...@@ -1170,21 +1172,20 @@ void rtl92ce_set_qos(struct ieee80211_hw *hw, int aci) ...@@ -1170,21 +1172,20 @@ void rtl92ce_set_qos(struct ieee80211_hw *hw, int aci)
{ {
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
u32 u4b_ac_param; u32 u4b_ac_param;
u16 cw_min = le16_to_cpu(mac->ac[aci].cw_min);
u16 cw_max = le16_to_cpu(mac->ac[aci].cw_max);
u16 tx_op = le16_to_cpu(mac->ac[aci].tx_op);
rtl92c_dm_init_edca_turbo(hw); rtl92c_dm_init_edca_turbo(hw);
u4b_ac_param = (u32) mac->ac[aci].aifs; u4b_ac_param = (u32) mac->ac[aci].aifs;
u4b_ac_param |= u4b_ac_param |= (u32) ((cw_min & 0xF) << AC_PARAM_ECW_MIN_OFFSET);
((u32) mac->ac[aci].cw_min & 0xF) << AC_PARAM_ECW_MIN_OFFSET; u4b_ac_param |= (u32) ((cw_max & 0xF) << AC_PARAM_ECW_MAX_OFFSET);
u4b_ac_param |= u4b_ac_param |= (u32) (tx_op << AC_PARAM_TXOP_OFFSET);
((u32) mac->ac[aci].cw_max & 0xF) << AC_PARAM_ECW_MAX_OFFSET;
u4b_ac_param |= (u32) mac->ac[aci].tx_op << AC_PARAM_TXOP_LIMIT_OFFSET;
RT_TRACE(rtlpriv, COMP_QOS, DBG_DMESG, RT_TRACE(rtlpriv, COMP_QOS, DBG_DMESG,
("queue:%x, ac_param:%x aifs:%x cwmin:%x cwmax:%x txop:%x\n", ("queue:%x, ac_param:%x aifs:%x cwmin:%x cwmax:%x txop:%x\n",
aci, u4b_ac_param, mac->ac[aci].aifs, mac->ac[aci].cw_min, aci, u4b_ac_param, mac->ac[aci].aifs, cw_min,
mac->ac[aci].cw_max, mac->ac[aci].tx_op)); cw_max, tx_op));
switch (aci) { switch (aci) {
case AC1_BK: case AC1_BK:
rtl_write_dword(rtlpriv, REG_EDCA_BK_PARAM, u4b_ac_param); rtl_write_dword(rtlpriv, REG_EDCA_BK_PARAM, u4b_ac_param);
...@@ -1712,7 +1713,7 @@ void rtl92ce_update_hal_rate_table(struct ieee80211_hw *hw) ...@@ -1712,7 +1713,7 @@ void rtl92ce_update_hal_rate_table(struct ieee80211_hw *hw)
struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
u32 ratr_value = (u32) mac->basic_rates; u32 ratr_value = (u32) mac->basic_rates;
u8 *p_mcsrate = mac->mcs; u8 *mcsrate = mac->mcs;
u8 ratr_index = 0; u8 ratr_index = 0;
u8 nmode = mac->ht_enable; u8 nmode = mac->ht_enable;
u8 mimo_ps = 1; u8 mimo_ps = 1;
...@@ -1723,7 +1724,7 @@ void rtl92ce_update_hal_rate_table(struct ieee80211_hw *hw) ...@@ -1723,7 +1724,7 @@ void rtl92ce_update_hal_rate_table(struct ieee80211_hw *hw)
u8 curshortgi_20mhz = mac->sgi_20; u8 curshortgi_20mhz = mac->sgi_20;
enum wireless_mode wirelessmode = mac->mode; enum wireless_mode wirelessmode = mac->mode;
ratr_value |= EF2BYTE((*(u16 *) (p_mcsrate))) << 12; ratr_value |= ((*(u16 *) (mcsrate))) << 12;
switch (wirelessmode) { switch (wirelessmode) {
case WIRELESS_MODE_B: case WIRELESS_MODE_B:
...@@ -1892,8 +1893,8 @@ void rtl92ce_update_hal_rate_mask(struct ieee80211_hw *hw, u8 rssi_level) ...@@ -1892,8 +1893,8 @@ void rtl92ce_update_hal_rate_mask(struct ieee80211_hw *hw, u8 rssi_level)
} }
RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG,
("ratr_bitmap :%x\n", ratr_bitmap)); ("ratr_bitmap :%x\n", ratr_bitmap));
*(u32 *)&rate_mask = EF4BYTE((ratr_bitmap & 0x0fffffff) | *(u32 *)&rate_mask = (ratr_bitmap & 0x0fffffff) |
(ratr_index << 28)); (ratr_index << 28);
rate_mask[4] = macid | (shortgi ? 0x20 : 0x00) | 0x80; rate_mask[4] = macid | (shortgi ? 0x20 : 0x00) | 0x80;
RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, ("Rate_index:%x, " RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, ("Rate_index:%x, "
"ratr_val:%x, %x:%x:%x:%x:%x\n", "ratr_val:%x, %x:%x:%x:%x:%x\n",
......
...@@ -1076,7 +1076,6 @@ ...@@ -1076,7 +1076,6 @@
#define _RARF_RC7(x) (((x) & 0x1F) << 16) #define _RARF_RC7(x) (((x) & 0x1F) << 16)
#define _RARF_RC8(x) (((x) & 0x1F) << 24) #define _RARF_RC8(x) (((x) & 0x1F) << 24)
#define AC_PARAM_TXOP_LIMIT_OFFSET 16
#define AC_PARAM_TXOP_OFFSET 16 #define AC_PARAM_TXOP_OFFSET 16
#define AC_PARAM_ECW_MAX_OFFSET 12 #define AC_PARAM_ECW_MAX_OFFSET 12
#define AC_PARAM_ECW_MIN_OFFSET 8 #define AC_PARAM_ECW_MIN_OFFSET 8
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include "trx.h" #include "trx.h"
#include "led.h" #include "led.h"
static enum rtl_desc_qsel _rtl92ce_map_hwqueue_to_fwqueue(u16 fc, static enum rtl_desc_qsel _rtl92ce_map_hwqueue_to_fwqueue(__le16 fc,
unsigned int unsigned int
skb_queue) skb_queue)
{ {
...@@ -617,13 +617,15 @@ static void _rtl92ce_translate_rx_signal_stuff(struct ieee80211_hw *hw, ...@@ -617,13 +617,15 @@ static void _rtl92ce_translate_rx_signal_stuff(struct ieee80211_hw *hw,
u8 *tmp_buf; u8 *tmp_buf;
u8 *praddr; u8 *praddr;
u8 *psaddr; u8 *psaddr;
u16 fc, type; __le16 fc;
u16 type, c_fc;
bool packet_matchbssid, packet_toself, packet_beacon; bool packet_matchbssid, packet_toself, packet_beacon;
tmp_buf = skb->data + pstats->rx_drvinfo_size + pstats->rx_bufshift; tmp_buf = skb->data + pstats->rx_drvinfo_size + pstats->rx_bufshift;
hdr = (struct ieee80211_hdr *)tmp_buf; hdr = (struct ieee80211_hdr *)tmp_buf;
fc = le16_to_cpu(hdr->frame_control); fc = hdr->frame_control;
c_fc = le16_to_cpu(fc);
type = WLAN_FC_GET_TYPE(fc); type = WLAN_FC_GET_TYPE(fc);
praddr = hdr->addr1; praddr = hdr->addr1;
psaddr = hdr->addr2; psaddr = hdr->addr2;
...@@ -631,8 +633,8 @@ static void _rtl92ce_translate_rx_signal_stuff(struct ieee80211_hw *hw, ...@@ -631,8 +633,8 @@ static void _rtl92ce_translate_rx_signal_stuff(struct ieee80211_hw *hw,
packet_matchbssid = packet_matchbssid =
((IEEE80211_FTYPE_CTL != type) && ((IEEE80211_FTYPE_CTL != type) &&
(!compare_ether_addr(mac->bssid, (!compare_ether_addr(mac->bssid,
(fc & IEEE80211_FCTL_TODS) ? (c_fc & IEEE80211_FCTL_TODS) ?
hdr->addr1 : (fc & IEEE80211_FCTL_FROMDS) ? hdr->addr1 : (c_fc & IEEE80211_FCTL_FROMDS) ?
hdr->addr2 : hdr->addr3)) && hdr->addr2 : hdr->addr3)) &&
(!pstats->hwerror) && (!pstats->crc) && (!pstats->icv)); (!pstats->hwerror) && (!pstats->crc) && (!pstats->icv));
...@@ -728,20 +730,17 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw, ...@@ -728,20 +730,17 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
bool defaultadapter = true; bool defaultadapter = true;
struct ieee80211_sta *sta = ieee80211_find_sta(mac->vif, mac->bssid); struct ieee80211_sta *sta = ieee80211_find_sta(mac->vif, mac->bssid);
u8 *pdesc = (u8 *) pdesc_tx; u8 *pdesc = (u8 *) pdesc_tx;
struct rtl_tcb_desc tcb_desc; struct rtl_tcb_desc tcb_desc;
u8 *qc = ieee80211_get_qos_ctl(hdr); u8 *qc = ieee80211_get_qos_ctl(hdr);
u8 tid = qc[0] & IEEE80211_QOS_CTL_TID_MASK; u8 tid = qc[0] & IEEE80211_QOS_CTL_TID_MASK;
u16 seq_number; u16 seq_number;
u16 fc = le16_to_cpu(hdr->frame_control); __le16 fc = hdr->frame_control;
u8 rate_flag = info->control.rates[0].flags; u8 rate_flag = info->control.rates[0].flags;
enum rtl_desc_qsel fw_qsel = enum rtl_desc_qsel fw_qsel =
_rtl92ce_map_hwqueue_to_fwqueue(le16_to_cpu(hdr->frame_control), _rtl92ce_map_hwqueue_to_fwqueue(fc, queue_index);
queue_index);
bool firstseg = ((hdr->seq_ctrl & bool firstseg = ((hdr->seq_ctrl &
cpu_to_le16(IEEE80211_SCTL_FRAG)) == 0); cpu_to_le16(IEEE80211_SCTL_FRAG)) == 0);
...@@ -901,7 +900,7 @@ void rtl92ce_tx_fill_cmddesc(struct ieee80211_hw *hw, ...@@ -901,7 +900,7 @@ void rtl92ce_tx_fill_cmddesc(struct ieee80211_hw *hw,
PCI_DMA_TODEVICE); PCI_DMA_TODEVICE);
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data); struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data);
u16 fc = le16_to_cpu(hdr->frame_control); __le16 fc = hdr->frame_control;
CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE); CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE);
......
...@@ -126,7 +126,7 @@ static u32 _usb_read_sync(struct usb_device *udev, u32 addr, u16 len) ...@@ -126,7 +126,7 @@ static u32 _usb_read_sync(struct usb_device *udev, u32 addr, u16 len)
wvalue = (u16)addr; wvalue = (u16)addr;
_usbctrl_vendorreq_sync_read(udev, request, wvalue, index, data, len); _usbctrl_vendorreq_sync_read(udev, request, wvalue, index, data, len);
ret = le32_to_cpu(*data); ret = *data;
kfree(data); kfree(data);
return ret; return ret;
} }
...@@ -163,7 +163,7 @@ static void _usb_write_async(struct usb_device *udev, u32 addr, u32 val, ...@@ -163,7 +163,7 @@ static void _usb_write_async(struct usb_device *udev, u32 addr, u32 val,
request = REALTEK_USB_VENQT_CMD_REQ; request = REALTEK_USB_VENQT_CMD_REQ;
index = REALTEK_USB_VENQT_CMD_IDX; /* n/a */ index = REALTEK_USB_VENQT_CMD_IDX; /* n/a */
wvalue = (u16)(addr&0x0000ffff); wvalue = (u16)(addr&0x0000ffff);
data = cpu_to_le32(val); data = val;
_usbctrl_vendorreq_async_write(udev, request, wvalue, index, &data, _usbctrl_vendorreq_async_write(udev, request, wvalue, index, &data,
len); len);
} }
...@@ -437,7 +437,7 @@ static void _rtl_usb_rx_process_agg(struct ieee80211_hw *hw, ...@@ -437,7 +437,7 @@ static void _rtl_usb_rx_process_agg(struct ieee80211_hw *hw,
u8 *rxdesc = skb->data; u8 *rxdesc = skb->data;
struct ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
bool unicast = false; bool unicast = false;
u16 fc; __le16 fc;
struct ieee80211_rx_status rx_status = {0}; struct ieee80211_rx_status rx_status = {0};
struct rtl_stats stats = { struct rtl_stats stats = {
.signal = 0, .signal = 0,
...@@ -449,7 +449,7 @@ static void _rtl_usb_rx_process_agg(struct ieee80211_hw *hw, ...@@ -449,7 +449,7 @@ static void _rtl_usb_rx_process_agg(struct ieee80211_hw *hw,
rtlpriv->cfg->ops->query_rx_desc(hw, &stats, &rx_status, rxdesc, skb); rtlpriv->cfg->ops->query_rx_desc(hw, &stats, &rx_status, rxdesc, skb);
skb_pull(skb, (stats.rx_drvinfo_size + stats.rx_bufshift)); skb_pull(skb, (stats.rx_drvinfo_size + stats.rx_bufshift));
hdr = (struct ieee80211_hdr *)(skb->data); hdr = (struct ieee80211_hdr *)(skb->data);
fc = le16_to_cpu(hdr->frame_control); fc = hdr->frame_control;
if (!stats.crc) { if (!stats.crc) {
memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status)); memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status));
...@@ -480,7 +480,7 @@ static void _rtl_usb_rx_process_noagg(struct ieee80211_hw *hw, ...@@ -480,7 +480,7 @@ static void _rtl_usb_rx_process_noagg(struct ieee80211_hw *hw,
u8 *rxdesc = skb->data; u8 *rxdesc = skb->data;
struct ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
bool unicast = false; bool unicast = false;
u16 fc; __le16 fc;
struct ieee80211_rx_status rx_status = {0}; struct ieee80211_rx_status rx_status = {0};
struct rtl_stats stats = { struct rtl_stats stats = {
.signal = 0, .signal = 0,
...@@ -492,7 +492,7 @@ static void _rtl_usb_rx_process_noagg(struct ieee80211_hw *hw, ...@@ -492,7 +492,7 @@ static void _rtl_usb_rx_process_noagg(struct ieee80211_hw *hw,
rtlpriv->cfg->ops->query_rx_desc(hw, &stats, &rx_status, rxdesc, skb); rtlpriv->cfg->ops->query_rx_desc(hw, &stats, &rx_status, rxdesc, skb);
skb_pull(skb, (stats.rx_drvinfo_size + stats.rx_bufshift)); skb_pull(skb, (stats.rx_drvinfo_size + stats.rx_bufshift));
hdr = (struct ieee80211_hdr *)(skb->data); hdr = (struct ieee80211_hdr *)(skb->data);
fc = le16_to_cpu(hdr->frame_control); fc = hdr->frame_control;
if (!stats.crc) { if (!stats.crc) {
memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status)); memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status));
...@@ -853,7 +853,7 @@ static void _rtl_usb_tx_preprocess(struct ieee80211_hw *hw, struct sk_buff *skb, ...@@ -853,7 +853,7 @@ static void _rtl_usb_tx_preprocess(struct ieee80211_hw *hw, struct sk_buff *skb,
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct rtl_tx_desc *pdesc = NULL; struct rtl_tx_desc *pdesc = NULL;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data); struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data);
u16 fc = le16_to_cpu(hdr->frame_control); __le16 fc = hdr->frame_control;
u8 *pda_addr = hdr->addr1; u8 *pda_addr = hdr->addr1;
/* ssn */ /* ssn */
u8 *qc = NULL; u8 *qc = NULL;
...@@ -892,7 +892,7 @@ static int rtl_usb_tx(struct ieee80211_hw *hw, struct sk_buff *skb) ...@@ -892,7 +892,7 @@ static int rtl_usb_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw)); struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data); struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data);
u16 fc = le16_to_cpu(hdr->frame_control); __le16 fc = hdr->frame_control;
u16 hw_queue; u16 hw_queue;
if (unlikely(is_hal_stop(rtlhal))) if (unlikely(is_hal_stop(rtlhal)))
......
...@@ -114,7 +114,7 @@ struct rtl_usb { ...@@ -114,7 +114,7 @@ struct rtl_usb {
u32 irq_mask[2]; u32 irq_mask[2];
bool irq_enabled; bool irq_enabled;
u16 (*usb_mq_to_hwq)(u16 fc, u16 mac80211_queue_index); u16 (*usb_mq_to_hwq)(__le16 fc, u16 mac80211_queue_index);
/* Tx */ /* Tx */
u8 out_ep_nums ; u8 out_ep_nums ;
......
...@@ -1427,7 +1427,7 @@ struct rtl_hal_usbint_cfg { ...@@ -1427,7 +1427,7 @@ struct rtl_hal_usbint_cfg {
/* endpoint mapping */ /* endpoint mapping */
int (*usb_endpoint_mapping)(struct ieee80211_hw *hw); int (*usb_endpoint_mapping)(struct ieee80211_hw *hw);
u16 (*usb_mq_to_hwq)(u16 fc, u16 mac80211_queue_index); u16 (*usb_mq_to_hwq)(__le16 fc, u16 mac80211_queue_index);
}; };
struct rtl_hal_cfg { struct rtl_hal_cfg {
...@@ -1646,7 +1646,7 @@ struct bt_coexist_info { ...@@ -1646,7 +1646,7 @@ struct bt_coexist_info {
#define READEF2BYTE(_ptr) \ #define READEF2BYTE(_ptr) \
EF2BYTE(*((u16 *)(_ptr))) EF2BYTE(*((u16 *)(_ptr)))
#define READEF4BYTE(_ptr) \ #define READEF4BYTE(_ptr) \
EF4BYTE(*((u32 *)(_ptr))) EF4BYTE(*((__le32 *)(_ptr)))
/* Write data to memory */ /* Write data to memory */
#define WRITEEF1BYTE(_ptr, _val) \ #define WRITEEF1BYTE(_ptr, _val) \
...@@ -1759,10 +1759,10 @@ Set subfield of little-endian 4-byte value to specified value. */ ...@@ -1759,10 +1759,10 @@ Set subfield of little-endian 4-byte value to specified value. */
#define packet_get_type(_packet) (EF1BYTE((_packet).octet[0]) & 0xFC) #define packet_get_type(_packet) (EF1BYTE((_packet).octet[0]) & 0xFC)
#define RTL_WATCH_DOG_TIME 2000 #define RTL_WATCH_DOG_TIME 2000
#define MSECS(t) msecs_to_jiffies(t) #define MSECS(t) msecs_to_jiffies(t)
#define WLAN_FC_GET_VERS(fc) ((fc) & IEEE80211_FCTL_VERS) #define WLAN_FC_GET_VERS(fc) (le16_to_cpu(fc) & IEEE80211_FCTL_VERS)
#define WLAN_FC_GET_TYPE(fc) ((fc) & IEEE80211_FCTL_FTYPE) #define WLAN_FC_GET_TYPE(fc) (le16_to_cpu(fc) & IEEE80211_FCTL_FTYPE)
#define WLAN_FC_GET_STYPE(fc) ((fc) & IEEE80211_FCTL_STYPE) #define WLAN_FC_GET_STYPE(fc) (le16_to_cpu(fc) & IEEE80211_FCTL_STYPE)
#define WLAN_FC_MORE_DATA(fc) ((fc) & IEEE80211_FCTL_MOREDATA) #define WLAN_FC_MORE_DATA(fc) (le16_to_cpu(fc) & IEEE80211_FCTL_MOREDATA)
#define SEQ_TO_SN(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4) #define SEQ_TO_SN(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4)
#define SN_TO_SEQ(ssn) (((ssn) << 4) & IEEE80211_SCTL_SEQ) #define SN_TO_SEQ(ssn) (((ssn) << 4) & IEEE80211_SCTL_SEQ)
#define MAX_SN ((IEEE80211_SCTL_SEQ) >> 4) #define MAX_SN ((IEEE80211_SCTL_SEQ) >> 4)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment