1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-25 21:18:26 +02:00

atusb/fw/: reset MAC state on ATUSB_RF_RESET

This commit is contained in:
Werner Almesberger 2013-02-13 09:30:21 -03:00
parent 276613da51
commit 852aaf1b66
3 changed files with 13 additions and 3 deletions

View File

@ -96,6 +96,7 @@ static int my_setup(const struct setup_request *setup)
case ATUSB_TO_DEV(ATUSB_RF_RESET): case ATUSB_TO_DEV(ATUSB_RF_RESET):
debug("ATUSB_RF_RESET\n"); debug("ATUSB_RF_RESET\n");
reset_rf(); reset_rf();
mac_reset();
//ep_send_zlp(EP_CTRL); //ep_send_zlp(EP_CTRL);
return 1; return 1;

View File

@ -167,3 +167,11 @@ int mac_tx(uint16_t flags, uint16_t len)
usb_recv(&eps[0], tx_buf, len, do_tx, NULL); usb_recv(&eps[0], tx_buf, len, do_tx, NULL);
return 1; return 1;
} }
void mac_reset(void)
{
mac_irq = NULL;
txing = 0;
queued_tx_ack = 0;
}

View File

@ -1,8 +1,8 @@
/* /*
* fw/mac.h - HardMAC functions * fw/mac.h - HardMAC functions
* *
* Written 2011 by Werner Almesberger * Written 2011, 2013 by Werner Almesberger
* Copyright 2011 Werner Almesberger * Copyright 2011, 2013 Werner Almesberger
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -20,5 +20,6 @@ extern int (*mac_irq)(void);
int mac_rx(int on); int mac_rx(int on);
int mac_tx(uint16_t flags, uint16_t len); int mac_tx(uint16_t flags, uint16_t len);
void mac_reset(void);
#endif /* !MAC_H */ #endif /* !MAC_H */