[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] [PATCH] USB mass storage partitions access (wrong patch!)



Sorry Alan wrong patch.
Attached is the good one.

Thanks!

2014-02-13 16:36 GMT+01:00 David Gálvez <dgalvez75@gmail.com>:
> Alan, please commit this patch.
>
> Commit message:
>
> Fix driver that was unable to access USB partitions when more than one
> were mounted.
Index: usb/src.km/udd/storage/bios.S
===================================================================
RCS file: /mint/freemint/sys/usb/src.km/udd/storage/bios.S,v
retrieving revision 1.7
diff -u -8 -r1.7 bios.S
--- usb/src.km/udd/storage/bios.S	18 Feb 2013 23:32:13 -0000	1.7
+++ usb/src.km/udd/storage/bios.S	13 Feb 2014 15:59:08 -0000
@@ -125,18 +125,25 @@
 	cmp.l #0xC,D2		// FAT32
 	beq.s .partition_ok
 	cmp.l #0x81,D2		// MINIX
 	beq.s .partition_ok
 	cmp.l #0x83,D2		// EXT2/LNX
 	bne .no_pinfo
 .partition_ok:
 	lea _pun_usb,A3
+	move.l pinfo_cookie(A3),D0	// PUN_INFO already installed?
+	cmp.l #0x41484449,D0		// AHDI
+	beq.s .pinfo_ok
 	move.l A3,pun_ptr
 	clr.w pinfo_puns(A3)
+	move.l #0x41484449,D0		// AHDI
+	move.l D0,pinfo_cookie(A3)
+	move.w #0x0300,D0
+	move.w D0,pinfo_vernum(A3)
 	move.w #0x4000,D0
 	move.w D0,pinfo_maxsiz(A3)
 	lea pinfo_pun(A3),A0
 	moveq #-1,D0
 	move.w D0,(A0)+          // drives A/B
 	move.l D0,(A0)+
 	move.l D0,(A0)+
 	move.l D0,(A0)+
Index: usb/src.km/udd/storage/usb_storage.c
===================================================================
RCS file: /mint/freemint/sys/usb/src.km/udd/storage/usb_storage.c,v
retrieving revision 1.8
diff -u -8 -r1.8 usb_storage.c
--- usb/src.km/udd/storage/usb_storage.c	4 Feb 2014 09:54:54 -0000	1.8
+++ usb/src.km/udd/storage/usb_storage.c	13 Feb 2014 15:59:09 -0000
@@ -1942,17 +1942,17 @@
 
 long
 usb_storage_init(void)
 {
 	unsigned char i;
 
 	usb_stor_curr_dev = -1;
 	usb_1st_disk_drive = 0;
-	max_logical_drive = 0;	
+	max_logical_drive = 32; /* max XHDI major numbers available for USB */
 
 	if(usb_stor_buf == NULL)
 		usb_stor_buf = (unsigned char *)kmalloc(512);
 	if(usb_stor_buf == NULL)
 		return -1;
 
 	memset(usb_stor_buf, 0, sizeof(usb_stor_buf));