From: Adrian M. <ad...@mc...> - 2002-11-04 00:23:51
|
This code doesn't work properly with multiple vmus attached. They are all reported as being attached to the same port at the same position. There is a crinkle in the vmu mtd code in that it assumes all vmus are the same (in reality they are, in theory they don't have to be) - but that means that they are all sharing the one mtd_info: hence they all report the same location. ---------- Forwarded Message ---------- Subject: [linuxdc-cvs] CVS: linux-sh-dc/drivers/mtd/maps vmu-flash.c,1.11,1.11.2.1 Date: Sun, 03 Nov 2002 06:23:16 -0800 From: "M. R. Brown" <mr...@us...> To: lin...@li... Update of /cvsroot/linuxdc/linux-sh-dc/drivers/mtd/maps In directory usw-pr-cvs1:/tmp/cvs-serv25520/drivers/mtd/maps Modified Files: Tag: linux-sh-dc-2_4-branch vmu-flash.c Log Message: Add port/unit info to mtd_info->name Index: vmu-flash.c =================================================================== RCS file: /cvsroot/linuxdc/linux-sh-dc/drivers/mtd/maps/vmu-flash.c,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -u -d -r1.11 -r1.11.2.1 --- vmu-flash.c 11 Sep 2002 20:09:07 -0000 1.11 +++ vmu-flash.c 3 Nov 2002 14:23:14 -0000 1.11.2.1 @@ -25,7 +25,8 @@ static int VMU_BLOCK_SIZE; -#define _DEBUG_ +/* Define this to get debugging messages */ +/* #define _DEBUG_ */ #ifdef _DEBUG_ #define DEBGM(fmt, args...) (printk(KERN_INFO fmt, ##args)) @@ -37,7 +38,7 @@ /* MTD Information */ static struct mtd_info *vmu_flash_mtd = NULL; - +static unsigned char mtdname[40]; static struct mapleq *lastmq; static struct maple_driver dc_flashmap_driver; @@ -557,6 +558,7 @@ static int dc_flashmap_connect(struct maple_driver_data *d) { + DEBGM ("Registering VMU Flash mapping and loading VMU Flash driver\n"); @@ -595,7 +597,6 @@ unsigned long basic_flash_data = be32_to_cpu(((unsigned long *) (lastmq->recvbuf))[1 + bit_cnt - controller_here]); - /* Create a permanent record * With thanks to Marcus Comstedt */ @@ -631,7 +632,6 @@ return -1; } - do { interruptible_sleep_on_timeout(&wq_mq, 1); } while (lastmq == NULL); @@ -648,7 +648,8 @@ /* Populate a mtd_info */ vmu_flash_mtd = kmalloc(512, GFP_KERNEL); - vmu_flash_mtd->name = "Dreamcast VMU Flash"; + sprintf(mtdname, "Dreamcast VMU Flash @ %c%c", ('A' + mqu->port), ('0' + mqu->unit)); + vmu_flash_mtd->name = mtdname; /* This is 'other' */ vmu_flash_mtd->type = MTD_OTHER; ------------------------------------------------------- This SF.net email is sponsored by: ApacheCon, November 18-21 in Las Vegas (supported by COMDEX), the only Apache event to be fully supported by the ASF. http://www.apachecon.com _______________________________________________ linuxdc-cvs mailing list lin...@li... https://lists.sourceforge.net/lists/listinfo/linuxdc-cvs ------------------------------------------------------- |