carl9170 firmware: checkpatch/style fixes
[carl9170fw.git] / carlfw / src / wlan.c
index bc9ddc12d66975520081baae9395d20f4e6011c6..50b1f2bb8b77c773903ed871ede9337bd5e25d95 100644 (file)
@@ -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)