summaryrefslogtreecommitdiff
path: root/firmware/usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/usb.c')
-rw-r--r--firmware/usb.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/firmware/usb.c b/firmware/usb.c
index e27c003154..ab8e080c45 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -157,17 +157,38 @@ static void usb_slave_mode(bool on)
157 panicf("ata: %d",rc); 157 panicf("ata: %d",rc);
158 } 158 }
159 159
160 pinfo = disk_init(); 160 pinfo = disk_init(IF_MV(0));
161 if (!pinfo) 161 if (!pinfo)
162 panicf("disk: NULL"); 162 panicf("disk: NULL");
163 163
164 fat_init();
164 for ( i=0; i<4; i++ ) { 165 for ( i=0; i<4; i++ ) {
165 rc = fat_mount(pinfo[i].start); 166 rc = fat_mount(IF_MV2(0,) IF_MV2(0,) pinfo[i].start);
166 if (!rc) 167 if (!rc)
167 break; 168 break; /* only one partition gets mounted as of now */
168 } 169 }
169 if (i==4) 170 if (i==4)
170 panicf("mount: %d",rc); 171 panicf("mount: %d",rc);
172#ifdef HAVE_MULTIVOLUME
173 /* mount partition on the optional volume */
174#ifdef HAVE_MMC
175 if (mmc_detect()) /* for Ondio, only if card detected */
176#endif
177 {
178 pinfo = disk_init(1);
179 if (pinfo)
180 {
181 for ( i=0; i<4; i++ ) {
182 if (!fat_mount(1, 1, pinfo[i].start))
183 break; /* only one partition gets mounted as of now */
184 }
185
186 if ( i==4 ) {
187 rc = fat_mount(1, 1, 0);
188 }
189 }
190 }
191#endif /* #ifdef HAVE_MULTIVOLUME */
171 } 192 }
172} 193}
173 194