X-Git-Url: https://jxself.org/git/?p=carl9170fw.git;a=blobdiff_plain;f=carlfw%2Fsrc%2Fwlan.c;h=50b1f2bb8b77c773903ed871ede9337bd5e25d95;hp=6c73b4840f5649c7b0cbb6a1597f4df8257c3ce3;hb=484cb254482ee644cc2981d1e2753fca2718bcd3;hpb=8bd3397985e442761ce6956b3ba2e126a2577c42 diff --git a/carlfw/src/wlan.c b/carlfw/src/wlan.c index 6c73b48..50b1f2b 100644 --- a/carlfw/src/wlan.c +++ b/carlfw/src/wlan.c @@ -213,7 +213,7 @@ static bool wlan_tx_consume_retry(struct carl9170_tx_superframe *super) static inline u16 get_tid(struct ieee80211_hdr *hdr) { - return (ieee80211_get_qos_ctl(hdr))[0] & IEEE80211_QOS_CTL_TID_MASK; + return (ieee80211_get_qos_ctl(hdr))[0] & IEEE80211_QOS_CTL_TID_MASK; } /* This function will only work on uint32_t-aligned pointers! */ @@ -330,9 +330,8 @@ static void _wlan_tx(struct dma_desc *desc) { struct carl9170_tx_superframe *super = get_super(desc); - if (unlikely(super->s.assign_seq)) { + if (unlikely(super->s.assign_seq)) wlan_assign_seq(&super->f.data.i3e, super->s.vif_id); - } if (unlikely(super->s.ampdu_commit_density)) { set(AR9170_MAC_REG_AMPDU_DENSITY, @@ -644,8 +643,8 @@ static void wlan_check_rx_overrun(void) { uint32_t overruns, total; - fw.wlan.rx_total += total = get(AR9170_MAC_REG_RX_TOTAL); - fw.wlan.rx_overruns += overruns = get(AR9170_MAC_REG_RX_OVERRUN); + fw.tally.rx_total += total = get(AR9170_MAC_REG_RX_TOTAL); + fw.tally.rx_overrun += overruns = get(AR9170_MAC_REG_RX_OVERRUN); if (unlikely(overruns)) { if (overruns == total) { DBG("RX Overrun"); @@ -730,9 +729,8 @@ static bool wlan_rx_wol_magic_packet(struct ieee80211_hdr *hdr, unsigned int len found = 0; } - if (found == (6 + 16 * 6)) { + if (found == (6 + 16 * 6)) return true; - } data++; } @@ -756,7 +754,7 @@ static void wlan_wol_connection_monitor(void) if (!fw.wlan.fw_desc_available) return; - memset(nullf, 0, sizeof(nullf)); + memset(nullf, 0, sizeof(*nullf)); nullf->s.len = sizeof(struct carl9170_tx_superdesc) + sizeof(struct ar9170_tx_hwdesc) + @@ -780,9 +778,9 @@ static void wlan_wol_connection_monitor(void) null->frame_control = cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC | IEEE80211_FCTL_TODS); - memcpy(null->addr1, fw.wlan.wol.cmd.bssid, 6); - memcpy(null->addr2, fw.wlan.wol.cmd.mac, 6); - memcpy(null->addr3, fw.wlan.wol.cmd.bssid, 6); + memcpy(null->addr1, fw.wlan.wol.cmd.bssid, 6); + memcpy(null->addr2, fw.wlan.wol.cmd.mac, 6); + memcpy(null->addr3, fw.wlan.wol.cmd.bssid, 6); wlan_tx_fw(&nullf->s, wlan_wol_connect_callback); } @@ -1120,10 +1118,12 @@ static void handle_pretbtt(void) fw.wlan.cab_flush_time = get_clock_counter(); #endif /* CONFIG_CARL9170FW_CAB_QUEUE */ +#ifdef CONFIG_CARL9170FW_RADIO_FUNCTIONS rf_psm(); send_cmd_to_host(4, CARL9170_RSP_PRETBTT, 0x00, (uint8_t *) &fw.phy.psm.state); +#endif /* CONFIG_CARL9170FW_RADIO_FUNCTIONS */ } static void handle_atim(void) @@ -1223,7 +1223,7 @@ static void wlan_check_hang(void) } /* fetch the current DMA queue position */ - desc = get_wlan_txq_addr(i); + desc = (struct dma_desc *)get_wlan_txq_addr(i); /* Stuck frame detection */ if (unlikely(DESC_PAYLOAD(desc) == fw.wlan.last_super[i])) {