Switch from GPLv2 to GPLv2+
[fw/altos] / src / kernel / ao_radio_cmac.c
index bff848f6d249fd797bfd02198619e5f366fe68e8..92b365a28569020825d4fdc201183813d24d21b6 100644 (file)
@@ -3,7 +3,8 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -91,7 +92,6 @@ radio_cmac_recv(uint8_t len, uint16_t timeout) __reentrant
                return AO_RADIO_CMAC_TIMEOUT;
        }
 
-       ao_radio_cmac_rssi = ao_radio_rssi;
        if (!(cmac_data[len + AO_CMAC_KEY_LEN +1] & AO_RADIO_STATUS_CRC_OK))
                return AO_RADIO_CMAC_CRC_ERROR;
 
@@ -114,13 +114,15 @@ radio_cmac_recv(uint8_t len, uint16_t timeout) __reentrant
        /* Check the packet signature against the signature provided
         * over the link
         */
-        
+
        if (memcmp(&cmac_data[len],
                   &cmac_data[len + AO_CMAC_KEY_LEN + 2],
                   AO_CMAC_KEY_LEN) != 0) {
                return AO_RADIO_CMAC_MAC_ERROR;
        }
 
+       ao_radio_cmac_rssi = ao_radio_rssi;
+
        return AO_RADIO_CMAC_OK;
 }
 
@@ -161,4 +163,3 @@ ao_radio_cmac_recv(__xdata void *packet, uint8_t len, uint16_t timeout) __reentr
        ao_mutex_put(&ao_radio_cmac_mutex);
        return i;
 }
-