From: michael Date: Wed, 23 Apr 2008 13:15:55 +0200 Subject: [U-Boot-Users] USB SUPPORT & get_vfatname In-Reply-To: <480EEFCC.3030009@gandalf.sssup.it> References: <480EDD25.3030809@gandalf.sssup.it> <480EEFCC.3030009@gandalf.sssup.it> Message-ID: <480F1A6B.6070207@gandalf.sssup.it> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, michael wrote: > Hi, > > Can you try this one? > > Revert my last one patch? > It change the test code, before the while. I use your script on a > Compact Flash and it looks fine for me (under linux). > > Regards Michael > > ------------------------------------------------------------------------ > > Check if the entry is a valid dir_slot entry, otherwise it is a dentry and the > name has to be taken by the get_name function > > Signed-off-by: michael trimarchi > > --- > fs/fat/fat.c | 7 +++++++ > 1 files changed, 7 insertions(+), 0 deletions(-) > > diff --git a/fs/fat/fat.c b/fs/fat/fat.c > index 49c78ed..bc37cec 100644 > --- a/fs/fat/fat.c > +++ b/fs/fat/fat.c > @@ -473,8 +473,14 @@ get_vfatname(fsdata *mydata, int curclust, __u8 *cluster, > while (slotptr2->id > 0x01) { > slotptr2++; > } > + > /* Save the real directory entry */ > realdent = (dir_entry*)slotptr2 + 1; > + if (slotptr2->attr != ATTR_VFAT) { > + get_name ((dir_entry *)realdent, l_name); > + goto out; > + } > + > while ((__u8*)slotptr2 >= get_vfatname_block) { > slot2str(slotptr2, l_name, &idx); > slotptr2--; > @@ -494,6 +500,7 @@ get_vfatname(fsdata *mydata, int curclust, __u8 *cluster, > else if (*l_name == aRING) *l_name = '?'; > downcase(l_name); > > +out: > /* Return the real directory entry */ > memcpy(retdent, realdent, sizeof(dir_entry)); > > The scripts in this thread can be used to test the fat32 filesystem. I do some tests using Compact Flash device and this patchs work for me. I would like to know if is a fat layer problem or usb layer problem. Michael