freemyipod r240 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r239‎ | r240 | r241 >
Date:14:04, 2 November 2010
Author:theseven
Status:new
Tags:
Comment:
emBIOS: Shut down USB controller before powering off or executing firmware image (disk mode fix part 1/2)
Modified paths:
  • /embios/trunk/shutdown.c (modified) (history)
  • /embios/trunk/usb/synopsysotg.c (modified) (history)
  • /embios/trunk/usb/usb.c (modified) (history)
  • /embios/trunk/usb/usb.h (modified) (history)
  • /embios/trunk/usb/usbdrv.h (modified) (history)

Diff [purge]

Index: embios/trunk/shutdown.c
@@ -28,6 +28,9 @@
2929 void shutdown(bool shutdownhw)
3030 {
3131 DEBUGF("Shutting down...");
 32+#ifdef HAVE_USB
 33+ usb_exit();
 34+#endif
3235 #ifdef HAVE_STORAGE_FLUSH
3336 storage_flush();
3437 #endif
Index: embios/trunk/usb/usb.h
@@ -33,6 +33,7 @@
3434 void usb_handle_transfer_complete(int endpoint, int dir, int status, int length);
3535 void usb_handle_bus_reset(void);
3636 void usb_init(void) INITCODE_ATTR;
 37+void usb_exit(void);
3738
3839
3940 #endif
Index: embios/trunk/usb/synopsysotg.c
@@ -412,6 +412,11 @@
413413 usb_drv_power_down();
414414 }
415415
 416+void usb_drv_exit(void)
 417+{
 418+ usb_drv_power_down();
 419+}
 420+
416421 int usb_drv_get_max_out_size()
417422 {
418423 return usb_drv_port_speed() ? 262144 : 32768;
Index: embios/trunk/usb/usb.c
@@ -853,3 +853,8 @@
854854 dbgconrecvreadidx += left;
855855 return available;
856856 }
 857+
 858+void usb_exit(void)
 859+{
 860+ usb_drv_exit();
 861+}
Index: embios/trunk/usb/usbdrv.h
@@ -39,6 +39,7 @@
4040 bool usb_drv_stalled(int endpoint, bool in);
4141 void usb_drv_stall(int endpoint, bool stall, bool in);
4242 void usb_drv_init(void) INITCODE_ATTR;
 43+void usb_drv_exit(void);
4344 int usb_drv_get_max_out_size();
4445 int usb_drv_get_max_in_size();
4546