carl9170 toolchain: update to gcc 9.1.0
[carl9170fw.git] / carlfw / src / hostif.c
index 57268607169afaa9a153c1f455d25b0a21598b6a..06726dbdf7d9c6e47b9556ef0a550c4b6c61a205 100644 (file)
@@ -19,8 +19,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "carl9170.h"
@@ -214,10 +213,14 @@ void handle_cmd(struct carl9170_rsp *resp)
                fw.reboot = 1;
                break;
 
-       case CARL9170_CMD_READ_TSF:
+       case CARL9170_CMD_READ_TSF: {
+               uint32_t tmptsf[2];
+
+               read_tsf(tmptsf);
                resp->hdr.len = 8;
-               read_tsf((uint32_t *)resp->tsf.tsf);
+               memcpy(resp->tsf.tsf, tmptsf, sizeof(tmptsf));
                break;
+               }
 
        case CARL9170_CMD_RX_FILTER:
                resp->hdr.len = 0;
@@ -235,6 +238,12 @@ void handle_cmd(struct carl9170_rsp *resp)
                memset(&fw.tally, 0, sizeof(struct carl9170_tally_rsp));
                break;
 
+       case CARL9170_CMD_WREGB:
+               resp->hdr.len = 0;
+               for (i = 0; i < MIN(cmd->wregb.count, cmd->hdr.len - 8); i++)
+                       setb(cmd->wregb.addr + i, cmd->wregb.val[i]);
+               break;
+
        case CARL9170_CMD_BCN_CTRL:
                resp->hdr.len = 0;