diff options
Diffstat (limited to 'firmware/target/arm/imx31/gigabeat-s/usb-target.h')
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/usb-target.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/usb-target.h b/firmware/target/arm/imx31/gigabeat-s/usb-target.h index c93400ca0b..7931058241 100644 --- a/firmware/target/arm/imx31/gigabeat-s/usb-target.h +++ b/firmware/target/arm/imx31/gigabeat-s/usb-target.h | |||
@@ -30,4 +30,17 @@ void usb_init_device(void); | |||
30 | /* Read the immediate state of the cable from the PMIC */ | 30 | /* Read the immediate state of the cable from the PMIC */ |
31 | bool usb_plugged(void); | 31 | bool usb_plugged(void); |
32 | 32 | ||
33 | /** Sector read/write filters **/ | ||
34 | |||
35 | /* Filter some things in the MBR - see usb-gigabeat-s.c */ | ||
36 | void usb_fix_mbr(unsigned char *mbr); | ||
37 | #define USBSTOR_READ_SECTORS_FILTER() \ | ||
38 | ({ if (cur_cmd.sector == 0) \ | ||
39 | usb_fix_mbr(cur_cmd.data[cur_cmd.data_select]); \ | ||
40 | 0; }) | ||
41 | |||
42 | /* Disallow MBR writes entirely since it was "fixed" in usb_fix_mbr */ | ||
43 | #define USBSTOR_WRITE_SECTORS_FILTER() \ | ||
44 | ({ cur_cmd.sector != 0 ? 0 : -1; }) | ||
45 | |||
33 | #endif /* USB_TARGET */ | 46 | #endif /* USB_TARGET */ |