diff options
Diffstat (limited to 'firmware/target/arm/imx31')
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/system-target.h | 15 | ||||
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/usb-target.h | 43 |
2 files changed, 15 insertions, 43 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/system-target.h b/firmware/target/arm/imx31/gigabeat-s/system-target.h index a8f7922dd5..533b2a1bd3 100644 --- a/firmware/target/arm/imx31/gigabeat-s/system-target.h +++ b/firmware/target/arm/imx31/gigabeat-s/system-target.h | |||
@@ -85,4 +85,19 @@ struct ARM_REGS { | |||
85 | 85 | ||
86 | void dumpregs(void); | 86 | void dumpregs(void); |
87 | 87 | ||
88 | void usb_connect_event(void); | ||
89 | |||
90 | /** Sector read/write filters **/ | ||
91 | |||
92 | /* Filter some things in the MBR - see usb-gigabeat-s.c */ | ||
93 | void usb_fix_mbr(unsigned char *mbr); | ||
94 | #define USBSTOR_READ_SECTORS_FILTER() \ | ||
95 | ({ if (cur_cmd.sector == 0) \ | ||
96 | usb_fix_mbr(cur_cmd.data[cur_cmd.data_select]); \ | ||
97 | 0; }) | ||
98 | |||
99 | /* Disallow MBR writes entirely since it was "fixed" in usb_fix_mbr */ | ||
100 | #define USBSTOR_WRITE_SECTORS_FILTER() \ | ||
101 | ({ cur_cmd.sector != 0 ? 0 : -1; }) | ||
102 | |||
88 | #endif /* SYSTEM_TARGET_H */ | 103 | #endif /* SYSTEM_TARGET_H */ |
diff --git a/firmware/target/arm/imx31/gigabeat-s/usb-target.h b/firmware/target/arm/imx31/gigabeat-s/usb-target.h deleted file mode 100644 index 60a9abd04c..0000000000 --- a/firmware/target/arm/imx31/gigabeat-s/usb-target.h +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Linus Nielsen Feltzing | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #ifndef USB_TARGET_H | ||
22 | #define USB_TARGET_H | ||
23 | |||
24 | #ifdef BOOTLOADER | ||
25 | #define USB_DRIVER_CLOSE | ||
26 | #endif | ||
27 | |||
28 | void usb_connect_event(void); | ||
29 | |||
30 | /** Sector read/write filters **/ | ||
31 | |||
32 | /* Filter some things in the MBR - see usb-gigabeat-s.c */ | ||
33 | void usb_fix_mbr(unsigned char *mbr); | ||
34 | #define USBSTOR_READ_SECTORS_FILTER() \ | ||
35 | ({ if (cur_cmd.sector == 0) \ | ||
36 | usb_fix_mbr(cur_cmd.data[cur_cmd.data_select]); \ | ||
37 | 0; }) | ||
38 | |||
39 | /* Disallow MBR writes entirely since it was "fixed" in usb_fix_mbr */ | ||
40 | #define USBSTOR_WRITE_SECTORS_FILTER() \ | ||
41 | ({ cur_cmd.sector != 0 ? 0 : -1; }) | ||
42 | |||
43 | #endif /* USB_TARGET */ | ||