--- linux-2.4.22-r29/drivers/ixp400/Makefile 2005-11-27 21:09:09.000000000 +0100 +++ linux-2.4.22/drivers/ixp400/Makefile 2005-11-27 21:25:15.000000000 +0100 @@ -80,9 +80,9 @@ # -- End Intel/GPL Copyright Notice -- # ifdef CONFIG_IXP425_CSR -include $(ROOTDIR)/IXP400lib/ixp400_xscale_sw/buildUtils/environment.linux +# include $(ROOTDIR)/IXP400lib/ixp400_xscale_sw/buildUtils/environment.linux # IX_XSCALE_SW=$(ROOTDIR)/IXP400lib/ixp400_xscale_sw/ # The kernel makefiles override the value of CFLAGS on the make # commandline. Because the xscale_sw makefile is supposed to be # stand-alone, we don't want this. So we reset the special variable @@ -136,15 +136,15 @@ # This rule builds the modules. # The dependency on modversions.h is needed here so it'll be built for # us in a 'make modules'. build_ixp400_modules: force $(TOPDIR)/include/linux/modversions.h - cd $(IX_XSCALE_SW); $(MAKE) IX_NOSYM=1 $(REAL_IXP400_MODULES:$(IX_XSCALE_SW)/%=%) +# cd $(IX_XSCALE_SW); $(MAKE) IX_NOSYM=1 $(REAL_IXP400_MODULES:$(IX_XSCALE_SW)/%=%) # After building the modules, we copy them to this directory as that's # where the kernel makefiles expect to find them. We can't use # symlinks, as Jungo's 'make ramdisk' rule would just copy the links. $(IXP400_MODULES): $(REAL_IXP400_MODULES) - cp $(IX_XSCALE_SW)/lib/linuxbe/$@ $@ +# cp $(IX_XSCALE_SW)/lib/linuxbe/$@ $@ # This macro is the interface to the rules in $(TOPDIR)/Rules.make. It # contains the names of all module files that can be built in this # directory. Note that they must be filenames in this directory - the --- R29/drivers/Makefile 2004-03-24 19:55:04.000000000 +0000 +++ R63/drivers/Makefile 2005-08-30 06:06:00.000000000 +0100 @@ -48,9 +48,4 @@ subdir-$(CONFIG_PCF8594C2) += i2c/pcf8594c-2 subdir-$(CONFIG_BLUEZ) += bluetooth - -ifdef CONFIG_ARCH_IXP425 -subdir-$(CONFIG_IXP425_CSR) += ixp400 -endif - include $(TOPDIR)/Rules.make --- R29/drivers/net/Makefile 2004-03-24 19:55:20.000000000 +0000 +++ R63/drivers/net/Makefile 2005-08-23 06:20:03.000000000 +0100 @@ -28,10 +28,7 @@ obj-$(CONFIG_OCP_NET) += ibm_emac/ocp.o ifdef CONFIG_IXP425_CSR -include $(ROOTDIR)/IXP400lib/ixp400_xscale_sw/buildUtils/environment.linux -CFLAGS_ixp425_eth.o = -I$(IX_XSCALE_SW)/src/linux \ - -I$(IX_XSCALE_SW)/src/include -obj-m += ixp425_eth.o +#obj-m += ixp425_eth.o endif ifeq ($(CONFIG_E1000),y) --- R29/drivers/scsi/hosts.c 2004-03-24 19:55:43.000000000 +0000 +++ R63/drivers/scsi/hosts.c 2005-04-05 02:40:53.000000000 +0100 @@ -36,12 +36,15 @@ #define __KERNEL_SYSCALLS__ #include - +//pete +#include +#include +// #include "scsi.h" #include "hosts.h" /* -static const char RCSid[] = "$Header: /home/cvsroot/NSLU2/linux-2.4.x/drivers/scsi/hosts.c,v 1.1.1.1 2004/03/24 19:55:43 sure Exp $"; +static const char RCSid[] = "$Header: /home/nas-cvsroot/NSLU2_V2/linux-2.4.x/drivers/scsi/hosts.c,v 1.2 2005/04/05 01:40:53 shearer Exp $"; */ /* @@ -84,6 +87,12 @@ int max_scsi_hosts; /* host_no for next new host */ int next_scsi_host; /* count of registered scsi hosts */ +//pete +extern pid_t sd_mc_thread_pid; +//extern DECLARE_COMPLETION(scsi_mc_thread_exited); +extern struct completion sd_mc_thread_exited; +// + void scsi_unregister(struct Scsi_Host * sh){ struct Scsi_Host * shpnt; @@ -110,6 +119,15 @@ next_scsi_host--; + //pete + //printk("+++++ scsi_unregister:next_scsi_host:%d\n", next_scsi_host); + if( next_scsi_host == 0){ + /* Send a signal to exit the thread. */ + kill_proc(sd_mc_thread_pid, SIGTERM, 1); + /* If no scsi host left, we wait the thread to exit. */ + wait_for_completion(&sd_mc_thread_exited); + } + // kfree((char *) sh); } --- R29/drivers/scsi/scsi.c 2004-03-24 19:55:45.000000000 +0000 +++ R63/drivers/scsi/scsi.c 2005-05-31 10:38:52.000000000 +0100 @@ -84,7 +84,7 @@ #endif /* - static const char RCSid[] = "$Header: /home/cvsroot/NSLU2/linux-2.4.x/drivers/scsi/scsi.c,v 1.1.1.1 2004/03/24 19:55:45 sure Exp $"; + static const char RCSid[] = "$Header: /home/nas-cvsroot/NSLU2_V2/linux-2.4.x/drivers/scsi/scsi.c,v 1.2 2005/05/31 09:38:52 shearer Exp $"; */ /* @@ -1991,9 +1991,10 @@ for (shpnt = scsi_hostlist; shpnt; shpnt = shpnt->next) { for (SDpnt = shpnt->host_queue; SDpnt; SDpnt = SDpnt->next) if (SDpnt->host->hostt == tpnt) { - for (sdtpnt = scsi_devicelist; sdtpnt; sdtpnt = sdtpnt->next) - if (sdtpnt->attach) - (*sdtpnt->attach) (SDpnt); + for (sdtpnt = scsi_devicelist; sdtpnt; sdtpnt = sdtpnt->next) + if (sdtpnt->attach){ + (*sdtpnt->attach) (SDpnt); + } if (SDpnt->attached) { scsi_build_commandblocks(SDpnt); if (0 == SDpnt->has_cmdblocks) @@ -2049,7 +2050,7 @@ char name[10]; /* host_no>=10^9? I don't think so. */ /* get the big kernel lock, so we don't race with open() */ - lock_kernel(); + lock_kernel(); /* * First verify that this host adapter is completely free with no pending --- R29/drivers/scsi/scsi.h 2004-07-07 09:01:24.000000000 +0100 +++ R63/drivers/scsi/scsi.h 2005-03-31 05:58:07.000000000 +0100 @@ -575,6 +575,9 @@ char type; char scsi_level; char vendor[8], model[16], rev[4]; + //pete + char node[6]; + // unsigned char current_tag; /* current tag */ unsigned char sync_min_period; /* Not less than this period */ unsigned char sync_max_offset; /* Not greater than this offset */ --- R29/drivers/scsi/scsi_proc.c 2004-03-24 19:55:45.000000000 +0000 +++ R63/drivers/scsi/scsi_proc.c 2004-10-28 09:54:56.000000000 +0100 @@ -263,8 +263,8 @@ extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE]; y = sprintf(buffer + len, - "Host: scsi%d Channel: %02d Id: %02d Lun: %02d\n Vendor: ", - scd->host->host_no, scd->channel, scd->id, scd->lun); + "Host: scsi%d-%s Channel: %02d Id: %02d Lun: %02d\n Vendor: ", + scd->host->host_no, /*pete*/scd->node, scd->channel, scd->id, scd->lun); for (x = 0; x < 8; x++) { if (scd->vendor[x] >= 0x20) y += sprintf(buffer + len + y, "%c", scd->vendor[x]); --- linux-2.4.22-r29/drivers/scsi/sd.c 2005-11-27 21:08:49.000000000 +0100 +++ linux-2.4.22/drivers/scsi/sd.c 2005-11-27 21:15:45.000000000 +0100 @@ -61,6 +61,10 @@ #include +//pete +#include +// + /* * static const char RCSid[] = "$Header:"; */ @@ -81,6 +85,9 @@ #define N_USED_SD_MAJORS (N_USED_SCSI_DISKS / SCSI_DISKS_PER_MAJOR) #define MAX_RETRIES 5 +//pete +#define SCSI_SEND_CMND_INTERVAL 5*HZ +// /* * Time out in seconds for disks and Magneto-opticals (which are slower). @@ -89,11 +96,16 @@ #define SD_TIMEOUT (30 * HZ) #define SD_MOD_TIMEOUT (75 * HZ) +// /* grant */ //#define GUID_EQUAL(x,y) (x[0]==y[0] && x[1]==y[1] && x[2]==y[2]) +//pete +static int port2_attached; +pid_t sd_mc_thread_pid; +DECLARE_COMPLETION(sd_mc_thread_exited); +// static Scsi_Disk *rscsi_disks; -//static Scsi_Disk *rscsi_disks; static struct gendisk *sd_gendisks; static int *sd_sizes; static int *sd_blocksizes; @@ -104,7 +116,9 @@ static int fop_revalidate_scsidisk(kdev_t); static int sd_init_onedisk(int); - +//pete +static int sd_send_cmnd_one(int); +// static int sd_init(void); static void sd_finish(void); @@ -113,6 +127,7 @@ static void sd_detach(Scsi_Device *); static int sd_init_command(Scsi_Cmnd *); + static struct Scsi_Device_Template sd_template = { name:"disk", tag:"sd", @@ -783,6 +798,11 @@ unsigned int the_result; int sector_size; Scsi_Request *SRpnt; + + //pete + char flash[12]="flash_"; + char hdd[10]="hdd_"; + // /* * Get the name of the disk, in case we need to log it somewhere. @@ -1053,6 +1073,7 @@ "%u %d-byte hdwr sectors (%u MB)\n", nbuff, rscsi_disks[i].capacity, hard_sector, (sz - sz/625 + 974)/1950); + } /* Rescale capacity to 512-byte units */ @@ -1065,6 +1086,55 @@ if (sector_size == 256) rscsi_disks[i].capacity >>= 1; } + // add by super, moified by pete + if (rscsi_disks[i].device->removable){ + if(0x32 == rscsi_disks[i].device->host->hostt->port){ + printk("is removable disk \n"); + *IXP425_GPIO_GPOUTR &= 0xfffb; + //port2_attached |= 1<<(i-1); + remove_proc_entry("flash_sda",NULL); + create_proc_read_entry("flash_sda", + 0, + NULL, + NULL, + NULL + ); + }else{ + strcat(flash,nbuff); + printk("is removable disk \n"); + *IXP425_GPIO_GPOUTR &= 0xfff7; + port2_attached |= 1<<(i-1); + remove_proc_entry(flash,NULL); + create_proc_read_entry(flash, + 0, + NULL, + NULL, + NULL + ); + } + }else { + printk("%x port connect!!!!!\n",rscsi_disks[i].device->host->hostt->port); + if(0x32 == rscsi_disks[i].device->host->hostt->port){ + *IXP425_GPIO_GPOUTR &= 0xfffb; + create_proc_read_entry("hdd_sda", + 0, + NULL, + NULL, + NULL + ); + }else{ + *IXP425_GPIO_GPOUTR &= 0xfff7; + port2_attached |= 1<<(i-1); + strcat(hdd,nbuff); + create_proc_read_entry(hdd, + 0, + NULL, + NULL, + NULL + ); + } + } + //end /* @@ -1124,6 +1194,140 @@ return i; } +//pete +static int sd_send_cmnd_one(int i) +{ + unsigned char cmd[10]; + char nbuff[6]; + unsigned char *buffer; + unsigned int the_result; + Scsi_Request *SRpnt; + + char media[24]; + /* + * Get the name of the disk, in case we need to log it somewhere. + */ + sd_devname(i, nbuff); + + /* + * If the device is offline, don't try and read capacity or any + * of the other niceties. + */ + if (rscsi_disks[i].device->online == FALSE) + return i; + + /* + * We need to retry the READ_CAPACITY because a UNIT_ATTENTION is + * considered a fatal error, and many devices report such an error + * just after a scsi bus reset. + */ + + SRpnt = scsi_allocate_request(rscsi_disks[i].device); + if (!SRpnt) { + printk(KERN_WARNING "(sd_init_onedisk:) Request allocation failure.\n"); + return i; + } + + buffer = (unsigned char *) scsi_malloc(512); + if (!buffer) { + printk(KERN_WARNING "(sd_init_onedisk:) Memory allocation failure.\n"); + scsi_release_request(SRpnt); + return i; + } + + cmd[0] = TEST_UNIT_READY; /* use this command to test media change */ + cmd[1] = (rscsi_disks[i].device->scsi_level <= SCSI_2) ? + ((rscsi_disks[i].device->lun << 5) & 0xe0) : 0; + memset((void *) &cmd[2], 0, 8); + SRpnt->sr_cmd_len = 0; + SRpnt->sr_sense_buffer[0] = 0; + SRpnt->sr_sense_buffer[2] = 0; + SRpnt->sr_data_direction = SCSI_DATA_NONE; + + scsi_wait_req (SRpnt, (void *) cmd, (void *) buffer, + 0/*512*/, SD_TIMEOUT, MAX_RETRIES); + + the_result = SRpnt->sr_result; + + sprintf(media, "sd%c_media_not_present", 'a' + i); + + /* -- code: 0x70, key: 0x2, ASC: 0x3a, ASCQ: 0x0 + this indicates Unit not ready: media not present */ + if( the_result != 0 + && ((driver_byte(the_result) & DRIVER_SENSE) != 0) + && SRpnt->sr_sense_buffer[0] == 0x70 + && (SRpnt->sr_sense_buffer[2]& 0xf) == NOT_READY + && SRpnt->sr_sense_buffer[12] == 0x3A + && SRpnt->sr_sense_buffer[13] == 0x0 ) { + //printk("sd%c media not present!\n", 'a' + i); + remove_proc_entry(media, NULL); + create_proc_read_entry(media, + 0, + NULL, + NULL, + NULL + ); + }else if(the_result == 0){ /* need more conditions? */ + remove_proc_entry(media, NULL); + } + + scsi_release_request(SRpnt); + SRpnt = NULL; + + scsi_free(buffer, 512); + return i; +} + +static int sd_send_cmnd_thread(void) +{ + int i; + + siginitsetinv(¤t->blocked, 0); + + //lock_kernel(); + + /* + * This thread doesn't need any user-level access, + * so get rid of all our resources.. + */ + exit_files(current); + current->files = init_task.files; + atomic_inc(¤t->files->count); + daemonize(); + reparent_to_init(); + + /* avoid getting signals */ + spin_lock_irq(¤t->sigmask_lock); + flush_signals(current); + sigfillset(¤t->blocked); + recalc_sigpending(current); + spin_unlock_irq(¤t->sigmask_lock); + + /* set our name for identification purposes */ + sprintf(current->comm, "sd-mc-thread"); + + //unlock_kernel(); + + do{ + /* If all scsi disks are removed, there will be no scsi host, so we should exit this thread. */ + if(next_scsi_host == 0) + break; + + for (i = 0; i < sd_template.dev_max; ++i) + if ( rscsi_disks[i].device) { + sd_send_cmnd_one(i); + } + + /* Now sleep for 5 seconds */ + current->state = TASK_INTERRUPTIBLE; + schedule_timeout(SCSI_SEND_CMND_INTERVAL); + }while(!signal_pending(current)); + + complete_and_exit(&sd_mc_thread_exited, 0); + return 0; +} +// + /* * The sd_init() function looks at all SCSI drives present, determines * their size, and reads partition table entries for them. @@ -1298,6 +1502,15 @@ : 4; /* 4 sector read-ahead */ } + //pete + //printk("-------------------in sd_finish------------------\n"); + if(next_scsi_host == 1){ + /* We just need *ONE* thread */ + sd_mc_thread_pid = kernel_thread(sd_send_cmnd_thread, NULL, CLONE_VM); + if(sd_mc_thread_pid < 0) + printk("Unable to start sd send command thread\n"); + } + // return; } @@ -1323,9 +1536,26 @@ SDp->attached--; return 1; } - for (dpnt = rscsi_disks, i = 0; i < sd_template.dev_max; i++, dpnt++) - if ( SDp == dpnt->device || !dpnt->device) /* grant */ - break; + + //Pete + if(SDp->host->host_no == 0){ + dpnt = rscsi_disks; + if(dpnt->device){ + SDp->attached--; + return 1; + } + i = 0; + } + else{ + //start from rscsi_disk[1]. + dpnt = rscsi_disks; + dpnt++; + i = 1; + for (; i < sd_template.dev_max; i++, dpnt++) + if (SDp == dpnt->device||!dpnt->device){ + break; + } + } if (i >= sd_template.dev_max) { printk(KERN_WARNING "scsi_devices corrupt (sd)," @@ -1334,18 +1564,7 @@ SDp->attached--; return 1; } - /* check different disks by grant */ - // i = SDp->removable;//super modify - printk("the host no is %d\n",SDp->host->host_no); - i = 1 - SDp->host->host_no; - if ( rscsi_disks[i].device )//&& - // !GUID_EQUAL( (struct us_data *)rscsi_disks[i].device->host->hostt->proc_dir->guid, - // (struct us_data *)SDp->host->hostt->proc_dir->guid) ) - { - sd_detach( rscsi_disks[i].device ); - printk("* sd_detach\n"); - } - printk("* sd_attach:%d\n",i); + rscsi_disks[i].device = SDp; rscsi_disks[i].has_part_table = 0; sd_template.nr_dev++; @@ -1355,6 +1574,9 @@ if (SDp->removable) SD_GENDISK(i).flags[devnum] |= GENHD_FL_REMOVABLE; sd_devname(i, nbuff); + //pete + strcpy(SDp->node, nbuff); + // printk("Attached scsi %sdisk %s at scsi%d, channel %d, id %d, lun %d\n", SDp->removable ? "removable " : "", nbuff, SDp->host->host_no, SDp->channel, SDp->id, SDp->lun); @@ -1434,29 +1656,65 @@ int i, j; int max_p; int start; + //pete + char flash[12]; + char hdd[10]; + char media[26]; + // if (rscsi_disks == NULL) return; + for (dpnt = rscsi_disks, i = 0; i < sd_template.dev_max; i++, dpnt++) if (dpnt->device == SDp) { + + #if 1 + //pete + sprintf(media, "sd%c_media_not_present", 'a' + i); + + switch(SDp->host->hostt->port){ + case 0x31: + port2_attached ^= 1<<(i-1); + if(port2_attached < 0) + port2_attached = 0; + if(port2_attached == 0) + *IXP425_GPIO_GPOUTR |= 0x8; + if(SDp->removable == 1){ + sprintf(flash, "flash_sd%c", 'a' + i); + remove_proc_entry(flash, NULL); + remove_proc_entry(media, NULL); + }else{ + sprintf(hdd, "hdd_sd%c", 'a' + i); + remove_proc_entry(hdd,NULL); + remove_proc_entry(media, NULL); + } + break; + case 0x32: + *IXP425_GPIO_GPOUTR |= 0x4; + if(SDp->removable == 1){ + remove_proc_entry("flash_sda",NULL); + } + else + remove_proc_entry("hdd_sda",NULL); + break; + default: + break; + } + #endif + // /* If we are disconnecting a disk driver, sync and invalidate * everything */ sdgd = &SD_GENDISK(i); max_p = sd_gendisk.max_p; start = i << sd_gendisk.minor_shift; -printk("max_p is %d ;start is %d\n",max_p,start); - for (j = max_p - 1; j >= 0; j--) { int index = start + j; - // printk("invalidate_device index = %d\n",index); - invalidate_device(MKDEV_SD_PARTITION(index), 1); + invalidate_device(MKDEV_SD_PARTITION(index), 0); sdgd->part[SD_MINOR_NUMBER(index)].start_sect = 0; sdgd->part[SD_MINOR_NUMBER(index)].nr_sects = 0; sd_sizes[index] = 0; - // printk("MKDEV_SD_PARTITION ok\n"); - } devfs_register_partitions (sdgd, SD_MINOR_NUMBER (start), 1); --- R29/drivers/usb/host/ehci-q.c 2004-07-07 08:31:43.000000000 +0100 +++ R63/drivers/usb/host/ehci-q.c 2005-02-03 04:59:48.000000000 +0000 @@ -39,6 +39,22 @@ */ /*-------------------------------------------------------------------------*/ + +//pete +void ehci_urb_dma_sync(struct usb_hcd *hcd, struct urb *urb) +{ + if (urb->setup_dma) + pci_dma_sync_single(hcd->pdev, urb->setup_dma, + sizeof(struct usb_ctrlrequest), + PCI_DMA_TODEVICE); + if (urb->transfer_buffer_length != 0) + pci_dma_sync_single(hcd->pdev, urb->transfer_dma, + urb->transfer_buffer_length, + usb_pipein(urb->pipe) + ? PCI_DMA_FROMDEVICE + : PCI_DMA_TODEVICE); +} +// /* fill a qtd, returning how much of the buffer we were able to queue up */ @@ -205,7 +221,16 @@ qh_put (ehci, qh); } + + spin_lock (&urb->lock); + +//pete: This fix the 2.0hub + 1.1 udisks bug + /* only control transfer makes trouble */ + if (usb_pipecontrol (urb->pipe)){ + ehci_urb_dma_sync(&ehci->hcd, urb); + } + urb->hcpriv = 0; switch (urb->status) { case -EINPROGRESS: /* success */ @@ -799,6 +824,10 @@ { struct ehci_qh *qh = 0; + //pete + //printk("in qh_append_tds\n"); + //show_bytes((unsigned char *)&urb->dev->descriptor, 18); + qh = (struct ehci_qh *) *ptr; if (unlikely (qh == 0)) { /* can't sleep here, we have ehci->lock... */ @@ -903,6 +932,9 @@ dummy->hw_token = token; urb->hcpriv = qh_get (qh); + //pete + //show_bytes((unsigned char *)&urb->dev->descriptor, 18); + //show_bytes((unsigned char *)&dma, 18); } } return qh; --- R29/drivers/usb/host/usb-uhci.c 2004-03-24 20:42:22.000000000 +0000 +++ R63/drivers/usb/host/usb-uhci.c 2004-11-11 09:38:55.000000000 +0000 @@ -16,7 +16,7 @@ * (C) Copyright 1999 Randy Dunlap * (C) Copyright 1999 Gregory P. Smith * - * $Id: usb-uhci.c,v 1.1 2004/03/24 20:42:22 sure Exp $ + * $Id: usb-uhci.c,v 1.3 2004/10/19 03:36:08 pete Exp $ */ #include @@ -53,7 +53,7 @@ /* This enables an extra UHCI slab for memory debugging */ #define DEBUG_SLAB -#define VERSTR "$Revision: 1.1 $ time " __TIME__ " " __DATE__ +#define VERSTR "$Revision: 1.3 $ time " __TIME__ " " __DATE__ #include #include "usb-uhci.h" @@ -2330,6 +2330,10 @@ status stage is completed */ + //Pete + //uhci_urb_dma_sync(s, urb, urb->hcpriv); + // + if (urb_priv->flags && ((qh->hw.qh.element == cpu_to_le32(UHCI_PTR_TERM)) || !is_td_active(desc))) goto transfer_finished; @@ -2364,6 +2368,10 @@ else if ((le32_to_cpu(desc->hw.td.info) & 0xff) != USB_PID_SETUP) urb->actual_length += actual_length; + //Pete + uhci_urb_dma_sync(s, urb, urb->hcpriv); + // + // got less data than requested if ( (actual_length < maxlength)) { if (urb->transfer_flags & USB_DISABLE_SPD) { --- R29/drivers/usb/hub.c 2004-03-24 19:55:48.000000000 +0000 +++ R63/drivers/usb/hub.c 2005-06-02 07:31:32.000000000 +0100 @@ -726,7 +726,6 @@ break; } - hub->children[port] = dev; /* Reset the device */ if (usb_hub_port_reset(hub, port, dev, delay)) { @@ -776,8 +775,11 @@ } /* Run it through the hoops (find a driver, etc) */ - if (!usb_new_device(dev)) + if (!usb_new_device(dev)){ + //pete + hub->children[port] = dev; goto done; + } /* Free the configuration if there was an error */ usb_free_dev(dev); @@ -896,9 +898,9 @@ usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_C_RESET); } // if (portchange&&(!list_empty(&hub_event_list.next))){ - if (portchange){ - break;//super - } +// if (portchange){ +// break;//super +// } } /* end for i */ /* deal with hub status changes */ --- linux-2.4.22-r29/drivers/usb/storage/transport.c 2005-11-27 21:09:04.000000000 +0100 +++ linux-2.4.22/drivers/usb/storage/transport.c 2005-11-28 15:56:40.000000000 +0100 @@ -1,6 +1,6 @@ /* Driver for USB Mass Storage compliant devices * - * $Id: transport.c,v 1.1 2004/03/24 20:43:17 sure Exp $ + * $Id: transport.c,v 1.2 2004/09/29 03:56:50 super Exp $ * * Current development and maintenance by: * (c) 1999-2002 Matthew Dharm (mdharm-usb@one-eyed-alien.net) @@ -1244,6 +1244,8 @@ goto out; } + udelay(100); /* For GL811E Chip */ + /* if the command transfered well, then we go to the data stage */ if (result == 0) { --- linux-2.4.22-r29/drivers/usb/storage/usb.c 2005-11-27 21:09:04.000000000 +0100 +++ linux-2.4.22/drivers/usb/storage/usb.c 2005-11-28 16:10:25.000000000 +0100 @@ -1,6 +1,6 @@ /* Driver for USB Mass Storage compliant devices * - * $Id: usb.c,v 1.2 2004/08/30 06:54:48 sure Exp $ + * $Id: usb.c,v 1.2 2004/10/08 03:41:34 pete Exp $ * * Current development and maintenance by: * (c) 1999-2002 Matthew Dharm (mdharm-usb@one-eyed-alien.net) @@ -561,7 +561,7 @@ GUID(guid); /* Global Unique Identifier */ unsigned int flags; struct us_unusual_dev *unusual_dev; - struct us_data *ss = NULL, *pre_ss, *tmp /* grant */; + struct us_data *ss = NULL; /* grant */; #ifdef CONFIG_USB_STORAGE_SDDR09 int result; #endif @@ -705,23 +705,11 @@ */ ss = us_list; /* modified to free unusable node by grant */ - pre_ss = us_list; + while ((ss != NULL) && ((ss->pusb_dev) || !GUID_EQUAL(guid, ss->guid))) - { - pre_ss = ss; ss = ss->next; - } - /* end mod */ -//super add -#if 0 - if (ss != NULL){ - scsi_unregister_module(MODULE_SCSI_HA, &(ss->htmplt)); - free_us_data( pre_ss, ss ); - usb_dec_dev_use(dev); - } -#endif -// + if (ss != NULL) { /* Existing device -- re-connect */ US_DEBUGP("Found existing GUID " GUID_FORMAT "\n", @@ -747,93 +735,6 @@ USB_ENDPOINT_NUMBER_MASK; ss->ep_int = ep_int; - /* grant 01/30 */ -#if 0 - if ( 0x32 != dev->bus->bus_name[6] ) - { - dev->devpath[0] = dev->bus->bus_name[6] + 1; - } - /* restrict device on certain port */ - if ( ss->htmplt.removable ^ (USB_DEVPATH_2 == dev->devpath[0]) ) - { - printk("* (old)%s disk not allowed on port:%s\n", ss->htmplt.removable ? "flash" : "hard", dev->devpath); - usb_dec_dev_use(dev); - scsi_unregister_module(MODULE_SCSI_HA, &(ss->htmplt)); - free_us_data( pre_ss, ss ); - return NULL; - } - if (ss->htmplt.removable){ - // add by super - remove_proc_entry("usb_conn",NULL); - *IXP425_GPIO_GPOUTR &= 0xfffb; - create_proc_read_entry("usb_conn", - 0, - NULL, - NULL, - NULL - ); - }else{ - remove_proc_entry("hd_conn",NULL); - *IXP425_GPIO_GPOUTR &= 0xfff7; - create_proc_read_entry("hd_conn", - 0, - NULL, - NULL, - NULL - ); - } - printk("rscsi_disk capacity is %d@@@@@@@@@@@@@@@@\n",ss->host->host_queue->sector_size); - if(ss->host->host_queue->sector_size<40000000){ - ss->htmplt.removable = 1; - } -#endif - /* restrict device on certain port */ - if ( ss->htmplt.removable && (USB_DEVPATH_1 == dev->devpath[0])) - if ( ss->htmplt.removable ^ (USB_DEVPATH_2 == dev->devpath[0]) ) - { - create_proc_read_entry("usb_err", - 0, - NULL, - NULL, - NULL - ); - printk("* (old)%s disk not allowed on port:%s\n", ss->htmplt.removable ? "flash" : "hard", dev->devpath); - usb_dec_dev_use(dev); - scsi_unregister_module(MODULE_SCSI_HA, &(ss->htmplt)); - free_us_data( pre_ss, ss ); - return NULL; - } - if (ss->htmplt.removable){ - printk("is removable disk \n"); - *IXP425_GPIO_GPOUTR &= 0xfffb; - create_proc_read_entry("usb_conn", - 0, - NULL, - NULL, - NULL - ); - }else { - printk("%x port connect\n",dev->devpath[0]); - if(0x31 == dev->devpath[0]){ - *IXP425_GPIO_GPOUTR &= 0xfff7; - create_proc_read_entry("hd_conn", - 0, - NULL, - NULL, - NULL - ); - }else{ - *IXP425_GPIO_GPOUTR &= 0xfffb; - create_proc_read_entry("hd2_conn", - 0, - NULL, - NULL, - NULL - ); - } - } - //end - /* allocate an IRQ callback if one is needed */ if ((ss->protocol == US_PR_CBI) && usb_stor_allocate_irq(ss)) { usb_dec_dev_use(dev); @@ -857,6 +756,23 @@ up(&(ss->dev_semaphore)); } else { +#if 0 + //grant,pete + if ( ss->htmplt.removable ^ (USB_DEVPATH_2 == dev->devpath[0]) ) + { + create_proc_read_entry("usb_err", + 0, + NULL, + NULL, + NULL + ); + printk("* (old)%s disk not allowed on port:%s\n", ss->htmplt.removable ? "flash" : "hard", dev->devpath); + usb_dec_dev_use(dev); + scsi_unregister_module(MODULE_SCSI_HA, &(ss->htmplt)); + return NULL; + } + // +#endif /* New device -- allocate memory and initialize */ US_DEBUGP("New GUID " GUID_FORMAT "\n", GUID_ARGS(guid)); @@ -1103,11 +1019,7 @@ sizeof(usb_stor_host_template)); /* Grab the next host number */ - //ss->host_number = my_host_number++; - - /* fix device name & host number by grant */ -// ss->host_number = dev->devpath[0] - USB_DEVPATH_1 ; - ss->host_number = USB_DEVPATH_2 - dev->devpath[0]; + ss->host_number = my_host_number++; /* We abuse this pointer so we can pass the ss pointer to * the host controller thread in us_detect. But how else are @@ -1128,7 +1040,6 @@ * the device if it needs initialization */ if (unusual_dev && unusual_dev->initFunction) unusual_dev->initFunction(ss); - printk("before kernel thread \n"); /* start up our control thread */ ss->pid = kernel_thread(usb_stor_control_thread, ss, CLONE_VM); @@ -1146,60 +1057,11 @@ /* now register - our detect function will be called */ ss->htmplt.module = THIS_MODULE; - /*debug by grant*/ -// printk("!! 1\n"); - /* grant 01/30 */ - // printk ("* bus = %c\n", dev->bus->bus_name[6]); - #if 0 - if ( 0x32 != dev->bus->bus_name[6] ) - { - dev->devpath[0] = dev->bus->bus_name[6] + 1; - // dev->devpath[0] = 0x32; - } -// printk("devpath = %c\n",dev->devpath[0]); -#endif ss->htmplt.port = dev->devpath[0]; - tmp = us_list; - pre_ss = tmp; - while ( NULL != tmp ) - { - /* free old device node by grant */ - if( (tmp->htmplt.port == ss->htmplt.port) && (!GUID_EQUAL(tmp->guid, ss->guid)) ) - { - scsi_unregister_module(MODULE_SCSI_HA, &(tmp->htmplt)); -// printk("* (2)scsi_unregister_module\n"); - free_us_data( pre_ss, tmp ); - break; - } - pre_ss = tmp; - tmp = tmp->next; - } - scsi_register_module(MODULE_SCSI_HA, &(ss->htmplt)); - /* check device port grant */ - if ( 1 == ss->host->porttype ) - { -// printk("* (usb)scsi_unregister_module\n"); - scsi_unregister_module(MODULE_SCSI_HA, &(ss->htmplt)); - kfree(ss->current_urb); - kfree(ss); - usb_dec_dev_use(dev); - return NULL; - } - - /* debug grant */ - i = 0; - tmp = us_list; - while ( NULL != tmp ) - { - i ++; - tmp = tmp->next; - } -// printk("* (usb)scsi_register_module okay! us_data:%d\n", i ); - /* lock access to the data structures */ down(&us_list_semaphore); @@ -1248,34 +1110,18 @@ } - /* Handle a disconnect event from the USB core */ static void storage_disconnect(struct usb_device *dev, void *ptr) { struct us_data *ss = ptr; -// struct us_data *pre_ss; + struct us_data *tmp,*pre_ss; int result; -//super add - char serial[USB_STOR_STRING_LEN]; /* serial number */ -// GUID(guid); /* Global Unique Identifier */ -//super modify - switch(dev->devpath[0]){ - case 0x31: - *IXP425_GPIO_GPOUTR |= 0x8; - remove_proc_entry("hd_conn",NULL); - break; - case 0x32: - *IXP425_GPIO_GPOUTR |= 0x4; - remove_proc_entry("usb_conn",NULL); - remove_proc_entry("hd2_conn",NULL); - break; - default: - break; - } -//end + //Pete + int i; + // + US_DEBUGP("storage_disconnect() called\n"); - memset(serial,0,USB_STOR_STRING_LEN); /* this is the odd case -- we disconnected but weren't using it */ if (!ss) { US_DEBUGP("-- device was not in use\n"); @@ -1285,6 +1131,35 @@ /* lock access to the device data structure */ down(&(ss->dev_semaphore)); + tmp = us_list; + pre_ss = tmp; + i = 0; + + while ( tmp != NULL ) + { + if( (tmp->htmplt.port == ss->htmplt.port) && (GUID_EQUAL(tmp->guid, ss->guid)) ) + { + scsi_unregister_module(MODULE_SCSI_HA, &(tmp->htmplt)); + if( ss == us_list ) + { + us_list = ss->next; + } + else if( ss->next == NULL ) + { + pre_ss->next = NULL; + } + else + { + pre_ss->next = ss->next; + } + + break; + } + i++; + pre_ss = tmp; + tmp = tmp->next; + } + if(ss->extra && ss->extra_destructor){ ss->extra_destructor(ss->extra); } --- R29/drivers/usb/usb.c 2004-07-07 08:31:44.000000000 +0100 +++ R63/drivers/usb/usb.c 2005-06-29 06:26:23.000000000 +0100 @@ -30,6 +30,7 @@ #include #include #include +#include #include #ifdef CONFIG_USB_DEBUG @@ -1014,12 +1015,11 @@ if (atomic_dec_and_test(&dev->refcnt)) { dev->bus->op->deallocate(dev); usb_destroy_configuration(dev); - usb_bus_put(dev->bus); - - + if(dev) kfree(dev); + dev = NULL; } } @@ -1749,6 +1749,7 @@ /* * Something got disconnected. Get rid of it, and all of its children. */ +static int dev_num=0; void usb_disconnect(struct usb_device **pdev) { struct usb_device * dev = *pdev; @@ -1758,35 +1759,9 @@ return; *pdev = NULL; - + info("USB disconnect on device %s-%s address %d", dev->bus->bus_name, dev->devpath, dev->devnum); -#if 0 - // add by super - switch(dev->devpath[0]){ - case 0x31: - *IXP425_GPIO_GPOUTR |= 0x8; - remove_proc_entry("hd_conn",NULL); - break; - case 0x32: - *IXP425_GPIO_GPOUTR |= 0x4; - remove_proc_entry("usb_conn",NULL); - remove_proc_entry("hd2_conn",NULL); - break; - default: - break; - } - if (*dev->devpath==0x31){ - *IXP425_GPIO_GPOUTR |= 0x8; - remove_proc_entry("hd_conn",NULL); - }else{ - *IXP425_GPIO_GPOUTR |= 0x4; - remove_proc_entry("usb_conn",NULL); - } -#endif - if (*dev->devpath==0x31) - remove_proc_entry("usb_err",NULL); - //end if (dev->actconfig) { for (i = 0; i < dev->actconfig->bNumInterfaces; i++) { struct usb_interface *interface = &dev->actconfig->interface[i]; @@ -1808,7 +1783,7 @@ if (*child) usb_disconnect(child); } - + /* Let policy agent unload modules etc */ call_policy ("remove", dev); @@ -1817,7 +1792,7 @@ clear_bit(dev->devnum, &dev->bus->devmap.devicemap); usbdevfs_remove_device(dev); } - + /* Free up the device itself */ usb_free_dev(dev); } @@ -2292,7 +2267,7 @@ wait_ms(10); /* Let the SET_ADDRESS settle */ -//super modify + //Pete err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, &dev->descriptor, 8); if (err < 8) { if (err < 0) @@ -2303,10 +2278,13 @@ dev->devnum = -1; return 1; } -// + + //pete, reserve this printk here! + printk("Device descriptor:%d bytes received.\n",err); + dev->epmaxpacketin [0] = dev->descriptor.bMaxPacketSize0; dev->epmaxpacketout[0] = dev->descriptor.bMaxPacketSize0; - + err = usb_get_device_descriptor(dev); if (err < (signed)sizeof(dev->descriptor)) { if (err < 0) @@ -2314,12 +2292,14 @@ else err("USB device descriptor short read (expected %Zi, got %i)", sizeof(dev->descriptor), err); - clear_bit(dev->devnum, &dev->bus->devmap.devicemap); dev->devnum = -1; return 1; } + //pete, reserve this printk here! + printk("Device descriptor:%d bytes received.\n",err); + err = usb_get_configuration(dev); if (err < 0) { err("unable to get device %d configuration (error=%d)", --- R29/fs/fat/dir.c 2004-03-24 19:56:01.000000000 +0000 +++ R63/fs/fat/dir.c 2005-03-31 04:30:53.000000000 +0100 @@ -198,11 +198,11 @@ int uni_xlate = MSDOS_SB(sb)->options.unicode_xlate; int utf8 = MSDOS_SB(sb)->options.utf8; unsigned short opt_shortname = MSDOS_SB(sb)->options.shortname; - int ino, chl, i, j, last_u, res = 0; - loff_t cpos = 0; + int chl, i, j, last_u, res = 0; + loff_t i_pos, cpos = 0; while(1) { - if (fat_get_entry(inode,&cpos,&bh,&de,&ino) == -1) + if (fat_get_entry(inode,&cpos,&bh,&de,&i_pos) == -1) goto EODir; parse_record: long_slots = 0; @@ -253,7 +253,7 @@ if (ds->id & 0x40) { unicode[offset + 13] = 0; } - if (fat_get_entry(inode,&cpos,&bh,&de,&ino)<0) + if (fat_get_entry(inode,&cpos,&bh,&de,&i_pos)<0) goto EODir; if (slot == 0) break; @@ -368,8 +368,9 @@ int utf8 = MSDOS_SB(sb)->options.utf8; int nocase = MSDOS_SB(sb)->options.nocase; unsigned short opt_shortname = MSDOS_SB(sb)->options.shortname; - int ino, inum, chi, chl, i, i2, j, last, last_u, dotoffset = 0; - loff_t cpos; + unsigned long inum; + int chi, chl, i, i2, j, last, last_u, dotoffset = 0; + loff_t i_pos, cpos; cpos = filp->f_pos; /* Fake . and .. for the root directory. */ @@ -392,7 +393,7 @@ bh = NULL; GetNew: long_slots = 0; - if (fat_get_entry(inode,&cpos,&bh,&de,&ino) == -1) + if (fat_get_entry(inode,&cpos,&bh,&de,&i_pos) == -1) goto EODir; /* Check for long filename entry */ if (isvfat) { @@ -449,7 +450,7 @@ if (ds->id & 0x40) { unicode[offset + 13] = 0; } - if (fat_get_entry(inode,&cpos,&bh,&de,&ino) == -1) + if (fat_get_entry(inode,&cpos,&bh,&de,&i_pos) == -1) goto EODir; if (slot == 0) break; @@ -541,7 +542,7 @@ /* inum = fat_parent_ino(inode,0); */ inum = filp->f_dentry->d_parent->d_inode->i_ino; } else { - struct inode *tmp = fat_iget(sb, ino); + struct inode *tmp = fat_iget(sb, i_pos); if (tmp) { inum = tmp->i_ino; iput(tmp); @@ -690,14 +691,14 @@ /***** See if directory is empty */ int fat_dir_empty(struct inode *dir) { - loff_t pos; + loff_t pos, i_pos; struct buffer_head *bh; struct msdos_dir_entry *de; - int ino,result = 0; + int result = 0; pos = 0; bh = NULL; - while (fat_get_entry(dir,&pos,&bh,&de,&ino) > -1) { + while (fat_get_entry(dir,&pos,&bh,&de,&i_pos) > -1) { /* Ignore vfat longname entries */ if (de->attr == ATTR_EXT) continue; @@ -717,7 +718,7 @@ /* This assumes that size of cluster is above the 32*slots */ int fat_add_entries(struct inode *dir,int slots, struct buffer_head **bh, - struct msdos_dir_entry **de, int *ino) + struct msdos_dir_entry **de, loff_t *i_pos) { struct super_block *sb = dir->i_sb; loff_t offset, curr; @@ -727,7 +728,7 @@ offset = curr = 0; *bh = NULL; row = 0; - while (fat_get_entry(dir,&curr,bh,de,ino) > -1) { + while (fat_get_entry(dir,&curr,bh,de,i_pos) > -1) { if (IS_FREE((*de)->name)) { if (++row == slots) return offset; @@ -742,7 +743,7 @@ if (!new_bh) return -ENOSPC; fat_brelse(sb, new_bh); - do fat_get_entry(dir,&curr,bh,de,ino); while (++row> FAT_HASH_BITS) + (tmp >> FAT_HASH_BITS * 2); return tmp & FAT_HASH_MASK; } -void fat_attach(struct inode *inode, int i_pos) +void fat_attach(struct inode *inode, loff_t i_pos) { spin_lock(&fat_inode_lock); - MSDOS_I(inode)->i_location = i_pos; + MSDOS_I(inode)->i_pos = i_pos; list_add(&MSDOS_I(inode)->i_fat_hash, fat_inode_hashtable + fat_hash(inode->i_sb, i_pos)); spin_unlock(&fat_inode_lock); @@ -102,13 +102,13 @@ void fat_detach(struct inode *inode) { spin_lock(&fat_inode_lock); - MSDOS_I(inode)->i_location = 0; + MSDOS_I(inode)->i_pos = 0; list_del(&MSDOS_I(inode)->i_fat_hash); INIT_LIST_HEAD(&MSDOS_I(inode)->i_fat_hash); spin_unlock(&fat_inode_lock); } -struct inode *fat_iget(struct super_block *sb, int i_pos) +struct inode *fat_iget(struct super_block *sb, loff_t i_pos) { struct list_head *p = fat_inode_hashtable + fat_hash(sb, i_pos); struct list_head *walk; @@ -120,7 +120,7 @@ i = list_entry(walk, struct msdos_inode_info, i_fat_hash); if (i->i_fat_inode->i_sb != sb) continue; - if (i->i_location != i_pos) + if (i->i_pos != i_pos) continue; inode = igrab(i->i_fat_inode); if (inode) @@ -133,11 +133,11 @@ static void fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de); struct inode *fat_build_inode(struct super_block *sb, - struct msdos_dir_entry *de, int ino, int *res) + struct msdos_dir_entry *de, loff_t i_pos, int *res) { struct inode *inode; *res = 0; - inode = fat_iget(sb, ino); + inode = fat_iget(sb, i_pos); if (inode) goto out; inode = new_inode(sb); @@ -147,7 +147,7 @@ *res = 0; inode->i_ino = iunique(sb, MSDOS_ROOT_INO); fat_fill_inode(inode, de); - fat_attach(inode, ino); + fat_attach(inode, i_pos); insert_inode_hash(inode); out: return inode; @@ -379,7 +379,7 @@ int nr; INIT_LIST_HEAD(&MSDOS_I(inode)->i_fat_hash); - MSDOS_I(inode)->i_location = 0; + MSDOS_I(inode)->i_pos = 0; MSDOS_I(inode)->i_fat_inode = inode; inode->i_uid = sbi->options.fs_uid; inode->i_gid = sbi->options.fs_gid; @@ -406,7 +406,7 @@ } inode->i_blksize = 1 << sbi->cluster_bits; inode->i_blocks = ((inode->i_size + inode->i_blksize - 1) - & ~(inode->i_blksize - 1)) >> 9; + & ~((loff_t)inode->i_blksize - 1)) >> 9; MSDOS_I(inode)->i_logstart = 0; MSDOS_I(inode)->mmu_private = inode->i_size; @@ -443,19 +443,25 @@ return ERR_PTR(-ESTALE); inode = iget(sb, fh[0]); - if (!inode || is_bad_inode(inode) || - inode->i_generation != fh[1]) { - if (inode) iput(inode); + if (!inode || is_bad_inode(inode) || inode->i_generation != fh[1]) { + if (inode) + iput(inode); inode = NULL; } if (!inode) { - /* try 2 - see if i_location is in F-d-c + loff_t i_pos; + int i_logstart = fh[3] & 0x0fffffff; + + i_pos = (loff_t)fh[2] << 8; + i_pos |= ((fh[3] >> 24) & 0xf0) | (fh[4] >> 28); + + /* try 2 - see if i_pos is in F-d-c * require i_logstart to be the same * Will fail if you truncate and then re-write */ - inode = fat_iget(sb, fh[2]); - if (inode && MSDOS_I(inode)->i_logstart != fh[3]) { + inode = fat_iget(sb, i_pos); + if (inode && MSDOS_I(inode)->i_logstart != i_logstart) { iput(inode); inode = NULL; } @@ -505,23 +511,26 @@ result->d_op = sb->s_root->d_op; result->d_flags |= DCACHE_NFSD_DISCONNECTED; return result; - - } int fat_dentry_to_fh(struct dentry *de, __u32 *fh, int *lenp, int needparent) { int len = *lenp; struct inode *inode = de->d_inode; + u32 ipos_h, ipos_m, ipos_l; if (len < 5) return 255; /* no room */ + + ipos_h = MSDOS_I(inode)->i_pos >> 8; + ipos_m = (MSDOS_I(inode)->i_pos & 0xf0) << 24; + ipos_l = (MSDOS_I(inode)->i_pos & 0x0f) << 28; *lenp = 5; fh[0] = inode->i_ino; fh[1] = inode->i_generation; - fh[2] = MSDOS_I(inode)->i_location; - fh[3] = MSDOS_I(inode)->i_logstart; - fh[4] = MSDOS_I(de->d_parent->d_inode)->i_logstart; + fh[2] = ipos_h; + fh[3] = ipos_m | MSDOS_I(inode)->i_logstart; + fh[4] = ipos_l | MSDOS_I(de->d_parent->d_inode)->i_logstart; return 3; } @@ -636,7 +645,7 @@ sbi->cluster_bits = ffs(logical_sector_size * sbi->cluster_size) - 1; sbi->fats = b->fats; - sbi->fat_start = CF_LE_W(b->reserved); + sbi->fat_start = CF_LE_W(b->reserved); sbi->prev_free = 0; if (!b->fat_length && b->fat32_length) { struct fat_boot_fsinfo *fsinfo; @@ -647,7 +656,8 @@ fat32 = 1; sbi->fat_length = CF_LE_L(b->fat32_length); sbi->root_cluster = CF_LE_L(b->root_cluster); - + sb->s_maxbytes = 0xffffffff; + sbi->fsinfo_sector = CF_LE_W(b->info_sector); /* MC - if info_sector is 0, don't multiply by 0 */ if (sbi->fsinfo_sector == 0) @@ -891,7 +901,7 @@ int nr; INIT_LIST_HEAD(&MSDOS_I(inode)->i_fat_hash); - MSDOS_I(inode)->i_location = 0; + MSDOS_I(inode)->i_pos = 0; MSDOS_I(inode)->i_fat_inode = inode; inode->i_uid = sbi->options.fs_uid; inode->i_gid = sbi->options.fs_gid; @@ -906,10 +916,9 @@ inode->i_fop = &fat_dir_operations; MSDOS_I(inode)->i_start = CF_LE_W(de->start); - if (sbi->fat_bits == 32) { - MSDOS_I(inode)->i_start |= - (CF_LE_W(de->starthi) << 16); - } + if (sbi->fat_bits == 32) + MSDOS_I(inode)->i_start |= (CF_LE_W(de->starthi) << 16); + MSDOS_I(inode)->i_logstart = MSDOS_I(inode)->i_start; inode->i_nlink = fat_subdirs(inode); /* includes .., compensating for "self" */ @@ -956,7 +965,7 @@ /* this is as close to the truth as we can get ... */ inode->i_blksize = 1 << sbi->cluster_bits; inode->i_blocks = ((inode->i_size + inode->i_blksize - 1) - & ~(inode->i_blksize - 1)) >> 9; + & ~((loff_t)inode->i_blksize - 1)) >> 9; inode->i_mtime = inode->i_atime = date_dos2unix(CF_LE_W(de->time),CF_LE_W(de->date)); inode->i_ctime = @@ -971,22 +980,22 @@ struct super_block *sb = inode->i_sb; struct buffer_head *bh; struct msdos_dir_entry *raw_entry; - unsigned int i_pos; + loff_t i_pos; retry: - i_pos = MSDOS_I(inode)->i_location; + i_pos = MSDOS_I(inode)->i_pos; if (inode->i_ino == MSDOS_ROOT_INO || !i_pos) { return; } lock_kernel(); if (!(bh = fat_bread(sb, i_pos >> MSDOS_SB(sb)->dir_per_block_bits))) { - printk("dev = %s, ino = %d\n", kdevname(inode->i_dev), i_pos); + printk("dev = %s, i_pos = %llu\n", kdevname(inode->i_dev), i_pos); fat_fs_panic(sb, "msdos_write_inode: unable to read i-node block"); unlock_kernel(); return; } spin_lock(&fat_inode_lock); - if (i_pos != MSDOS_I(inode)->i_location) { + if (i_pos != MSDOS_I(inode)->i_pos) { spin_unlock(&fat_inode_lock); fat_brelse(sb, bh); unlock_kernel(); --- R29/fs/fat/misc.c 2004-03-24 19:56:01.000000000 +0000 +++ R63/fs/fat/misc.c 2005-03-31 04:20:35.000000000 +0100 @@ -316,11 +316,12 @@ */ int fat__get_entry(struct inode *dir, loff_t *pos,struct buffer_head **bh, - struct msdos_dir_entry **de, int *ino) + struct msdos_dir_entry **de, loff_t *i_pos) { struct super_block *sb = dir->i_sb; struct msdos_sb_info *sbi = MSDOS_SB(sb); - int sector, offset; + int sector; + loff_t offset; while (1) { offset = *pos; @@ -343,7 +344,7 @@ offset &= sb->s_blocksize - 1; *de = (struct msdos_dir_entry *) ((*bh)->b_data + offset); - *ino = (sector << sbi->dir_per_block_bits) + (offset >> MSDOS_DIR_BITS); + *i_pos = ((loff_t)sector << sbi->dir_per_block_bits) + (offset >> MSDOS_DIR_BITS); return 0; } @@ -383,7 +384,7 @@ done = !IS_FREE(data[entry].name) \ && ( \ ( \ - (MSDOS_SB(sb)->fat_bits != 32) ? 0 : (CF_LE_W(data[entry].starthi) << 16) \ + (sbi->fat_bits != 32) ? 0 : (CF_LE_W(data[entry].starthi) << 16) \ ) \ | CF_LE_W(data[entry].start) \ ) == *number; @@ -400,35 +401,38 @@ (*number)++; \ } -static int raw_scan_sector(struct super_block *sb,int sector,const char *name, - int *number,int *ino,struct buffer_head **res_bh, - struct msdos_dir_entry **res_de) +static int raw_scan_sector(struct super_block *sb, int sector, + const char *name, int *number, loff_t *i_pos, + struct buffer_head **res_bh, + struct msdos_dir_entry **res_de) { + struct msdos_sb_info *sbi = MSDOS_SB(sb); struct buffer_head *bh; struct msdos_dir_entry *data; int entry,start,done; - if (!(bh = fat_bread(sb,sector))) + if (!(bh = fat_bread(sb, sector))) return -EIO; data = (struct msdos_dir_entry *) bh->b_data; - for (entry = 0; entry < MSDOS_SB(sb)->dir_per_block; entry++) { + for (entry = 0; entry < sbi->dir_per_block; entry++) { /* RSS_COUNT: if (data[entry].name == name) done=true else done=false. */ if (name) { RSS_NAME } else { - if (!ino) RSS_COUNT + if (!i_pos) RSS_COUNT else { if (number) RSS_START else RSS_FREE } } if (done) { - if (ino) - *ino = sector * MSDOS_SB(sb)->dir_per_block + entry; + if (i_pos) { + *i_pos = ((loff_t)sector << sbi->dir_per_block_bits) + entry; + } start = CF_LE_W(data[entry].start); - if (MSDOS_SB(sb)->fat_bits == 32) { + if (sbi->fat_bits == 32) start |= (CF_LE_W(data[entry].starthi) << 16); - } + if (!res_bh) fat_brelse(sb, bh); else { @@ -448,16 +452,19 @@ * requested entry is found or the end of the directory is reached. */ -static int raw_scan_root(struct super_block *sb,const char *name,int *number,int *ino, - struct buffer_head **res_bh,struct msdos_dir_entry **res_de) +static int raw_scan_root(struct super_block *sb, const char *name, + int *number, loff_t *i_pos, + struct buffer_head **res_bh, + struct msdos_dir_entry **res_de) { int count,cluster; for (count = 0; count < MSDOS_SB(sb)->dir_entries / MSDOS_SB(sb)->dir_per_block; count++) { - if ((cluster = raw_scan_sector(sb,MSDOS_SB(sb)->dir_start+count, - name,number,ino,res_bh,res_de)) >= 0) + cluster = raw_scan_sector(sb, MSDOS_SB(sb)->dir_start + count, + name, number, i_pos, res_bh, res_de); + if (cluster >= 0) return cluster; } return -ENOENT; @@ -469,20 +476,24 @@ * requested entry is found or the end of the directory is reached. */ -static int raw_scan_nonroot(struct super_block *sb,int start,const char *name, - int *number,int *ino,struct buffer_head **res_bh,struct msdos_dir_entry - **res_de) +static int raw_scan_nonroot(struct super_block *sb, int start, const char *name, + int *number, loff_t *i_pos, + struct buffer_head **res_bh, + struct msdos_dir_entry **res_de) { - int count,cluster; + struct msdos_sb_info *sbi = MSDOS_SB(sb); + int count, cluster, sector; #ifdef DEBUG printk("raw_scan_nonroot: start=%d\n",start); #endif do { - for (count = 0; count < MSDOS_SB(sb)->cluster_size; count++) { - if ((cluster = raw_scan_sector(sb,(start-2)* - MSDOS_SB(sb)->cluster_size+MSDOS_SB(sb)->data_start+ - count,name,number,ino,res_bh,res_de)) >= 0) + for (count = 0; count < sbi->cluster_size; count++) { + sector = (start - 2) * sbi->cluster_size + + count + sbi->data_start; + cluster = raw_scan_sector(sb, sector, name, number, + i_pos, res_bh, res_de); + if (cluster >= 0) return cluster; } if (!(start = fat_access(sb,start,-1))) { @@ -506,13 +517,13 @@ */ static int raw_scan(struct super_block *sb, int start, const char *name, - int *number, int *ino, struct buffer_head **res_bh, - struct msdos_dir_entry **res_de) + loff_t *i_pos, struct buffer_head **res_bh, + struct msdos_dir_entry **res_de) { if (start) - return raw_scan_nonroot(sb,start,name,number,ino,res_bh,res_de); + return raw_scan_nonroot(sb,start,name,NULL,i_pos,res_bh,res_de); else - return raw_scan_root(sb,name,number,ino,res_bh,res_de); + return raw_scan_root(sb,name,NULL,i_pos,res_bh,res_de); } /* @@ -521,19 +532,21 @@ */ int fat_subdirs(struct inode *dir) { - int count; + struct msdos_sb_info *sbi = MSDOS_SB(dir->i_sb); + int number; - count = 0; - if ((dir->i_ino == MSDOS_ROOT_INO) && - (MSDOS_SB(dir->i_sb)->fat_bits != 32)) { - (void) raw_scan_root(dir->i_sb,NULL,&count,NULL,NULL,NULL); - } else { - if ((dir->i_ino != MSDOS_ROOT_INO) && - !MSDOS_I(dir)->i_start) return 0; /* in mkdir */ - else (void) raw_scan_nonroot(dir->i_sb,MSDOS_I(dir)->i_start, - NULL,&count,NULL,NULL,NULL); + number = 0; + if ((dir->i_ino == MSDOS_ROOT_INO) && (sbi->fat_bits != 32)) + raw_scan_root(dir->i_sb, NULL, &number, NULL, NULL, NULL); + else { + if ((dir->i_ino != MSDOS_ROOT_INO) && !MSDOS_I(dir)->i_start) + return 0; /* in mkdir */ + else { + raw_scan_nonroot(dir->i_sb, MSDOS_I(dir)->i_start, + NULL, &number, NULL, NULL, NULL); + } } - return count; + return number; } @@ -542,12 +555,12 @@ * for an empty directory slot (name is NULL). Returns an error code or zero. */ -int fat_scan(struct inode *dir,const char *name,struct buffer_head **res_bh, - struct msdos_dir_entry **res_de,int *ino) +int fat_scan(struct inode *dir, const char *name, struct buffer_head **res_bh, + struct msdos_dir_entry **res_de, loff_t *i_pos) { int res; - res = raw_scan(dir->i_sb,MSDOS_I(dir)->i_start, - name, NULL, ino, res_bh, res_de); - return res<0 ? res : 0; + res = raw_scan(dir->i_sb, MSDOS_I(dir)->i_start, name, i_pos, + res_bh, res_de); + return (res < 0) ? res : 0; } --- R29/fs/nls/nls_cp932.c 2004-03-24 19:56:02.000000000 +0000 +++ R63/fs/nls/nls_cp932.c 2005-08-09 03:30:27.000000000 +0100 @@ -7859,7 +7859,7 @@ if (boundlen <= 0) return -ENAMETOOLONG; - if (rawstring[0] <= 0x7F) { + if (rawstring[0] <= 0x7F || !(rawstring[1]>=0x40 && rawstring[1]<=0xFC && rawstring[1]!=0x7F)) { *uni = rawstring[0]; return 1; } --- R29/fs/nls/nls_cp936.c 2004-03-24 19:56:02.000000000 +0000 +++ R63/fs/nls/nls_cp936.c 2005-08-09 04:01:39.000000000 +0100 @@ -3,8 +3,10 @@ * * Charset cp936 translation tables. * This translation table was generated automatically, the - * original table can be download from the Microsoft website. - * (http://www.microsoft.com/typography/unicode/unicodecp.htm) + * original table can be found at the Microsoft website. + * (http://www.microsoft.com/globaldev/reference/dbcs/936.htm) + * download GBK.TXT from MIT Edu website + * (http://web.mit.edu/afs/dev.mit.edu/source/src-current/third/libiconv/tests/GBK.TXT) */ #include @@ -29,7 +31,7 @@ 0x4E63,0x4E64,0x4E65,0x4E67,0x4E68,0x4E6A,0x4E6B,0x4E6C,/* 0x60-0x67 */ 0x4E6D,0x4E6E,0x4E6F,0x4E72,0x4E74,0x4E75,0x4E76,0x4E77,/* 0x68-0x6F */ 0x4E78,0x4E79,0x4E7A,0x4E7B,0x4E7C,0x4E7D,0x4E7F,0x4E80,/* 0x70-0x77 */ - 0x4E81,0xF91B,0x4E83,0x4E84,0x4E85,0x4E87,0x4E8A,0x0000,/* 0x78-0x7F */ + 0x4E81,0x4E82,0x4E83,0x4E84,0x4E85,0x4E87,0x4E8A,0x0000,/* 0x78-0x7F */ 0x4E90,0x4E96,0x4E97,0x4E99,0x4E9C,0x4E9D,0x4E9E,0x4EA3,/* 0x80-0x87 */ 0x4EAA,0x4EAF,0x4EB0,0x4EB1,0x4EB4,0x4EB6,0x4EB7,0x4EB8,/* 0x88-0x8F */ @@ -44,7 +46,7 @@ 0x4F47,0x4F48,0x4F49,0x4F4A,0x4F4B,0x4F4C,0x4F52,0x4F54,/* 0xD0-0xD7 */ 0x4F56,0x4F61,0x4F62,0x4F66,0x4F68,0x4F6A,0x4F6B,0x4F6D,/* 0xD8-0xDF */ 0x4F6E,0x4F71,0x4F72,0x4F75,0x4F77,0x4F78,0x4F79,0x4F7A,/* 0xE0-0xE7 */ - 0x4F7D,0x4F80,0x4F81,0x4F82,0x4F85,0xF92D,0x4F87,0x4F8A,/* 0xE8-0xEF */ + 0x4F7D,0x4F80,0x4F81,0x4F82,0x4F85,0x4F86,0x4F87,0x4F8A,/* 0xE8-0xEF */ 0x4F8C,0x4F8E,0x4F90,0x4F92,0x4F93,0x4F95,0x4F96,0x4F98,/* 0xF0-0xF7 */ 0x4F99,0x4F9A,0x4F9C,0x4F9E,0x4F9F,0x4FA1,0x4FA2,0x0000,/* 0xF8-0xFF */ }; @@ -69,7 +71,7 @@ 0x500B,0x500E,0x5010,0x5011,0x5013,0x5015,0x5016,0x5017,/* 0x80-0x87 */ 0x501B,0x501D,0x501E,0x5020,0x5022,0x5023,0x5024,0x5027,/* 0x88-0x8F */ - 0xF9D4,0x502F,0x5030,0x5031,0x5032,0x5033,0x5034,0x5035,/* 0x90-0x97 */ + 0x502B,0x502F,0x5030,0x5031,0x5032,0x5033,0x5034,0x5035,/* 0x90-0x97 */ 0x5036,0x5037,0x5038,0x5039,0x503B,0x503D,0x503F,0x5040,/* 0x98-0x9F */ 0x5041,0x5042,0x5044,0x5045,0x5046,0x5049,0x504A,0x504B,/* 0xA0-0xA7 */ 0x504D,0x5050,0x5051,0x5052,0x5053,0x5054,0x5056,0x5057,/* 0xA8-0xAF */ @@ -112,7 +114,7 @@ 0x513C,0x513D,0x513E,0x5142,0x5147,0x514A,0x514C,0x514E,/* 0xB0-0xB7 */ 0x514F,0x5150,0x5152,0x5153,0x5157,0x5158,0x5159,0x515B,/* 0xB8-0xBF */ 0x515D,0x515E,0x515F,0x5160,0x5161,0x5163,0x5164,0x5166,/* 0xC0-0xC7 */ - 0x5167,0xF978,0x516A,0x516F,0x5172,0x517A,0x517E,0x517F,/* 0xC8-0xCF */ + 0x5167,0x5169,0x516A,0x516F,0x5172,0x517A,0x517E,0x517F,/* 0xC8-0xCF */ 0x5183,0x5184,0x5186,0x5187,0x518A,0x518B,0x518E,0x518F,/* 0xD0-0xD7 */ 0x5190,0x5191,0x5193,0x5194,0x5198,0x519A,0x519D,0x519E,/* 0xD8-0xDF */ 0x519F,0x51A1,0x51A3,0x51A6,0x51A7,0x51A8,0x51A9,0x51AA,/* 0xE0-0xE7 */ @@ -130,7 +132,7 @@ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x28-0x2F */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x30-0x37 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x38-0x3F */ - 0x51D8,0x51D9,0x51DA,0xF954,0xFA15,0x51DF,0x51E2,0x51E3,/* 0x40-0x47 */ + 0x51D8,0x51D9,0x51DA,0x51DC,0x51DE,0x51DF,0x51E2,0x51E3,/* 0x40-0x47 */ 0x51E5,0x51E6,0x51E7,0x51E8,0x51E9,0x51EA,0x51EC,0x51EE,/* 0x48-0x4F */ 0x51F1,0x51F2,0x51F4,0x51F7,0x51FE,0x5204,0x5205,0x5209,/* 0x50-0x57 */ 0x520B,0x520C,0x520F,0x5210,0x5213,0x5214,0x5215,0x521C,/* 0x58-0x5F */ @@ -143,16 +145,16 @@ 0x5264,0x5266,0x5268,0x526B,0x526C,0x526D,0x526E,0x5270,/* 0x88-0x8F */ 0x5271,0x5273,0x5274,0x5275,0x5276,0x5277,0x5278,0x5279,/* 0x90-0x97 */ 0x527A,0x527B,0x527C,0x527E,0x5280,0x5283,0x5284,0x5285,/* 0x98-0x9F */ - 0x5286,0x5287,0xF9C7,0x528A,0x528B,0x528C,0x528D,0x528E,/* 0xA0-0xA7 */ + 0x5286,0x5287,0x5289,0x528A,0x528B,0x528C,0x528D,0x528E,/* 0xA0-0xA7 */ 0x528F,0x5291,0x5292,0x5294,0x5295,0x5296,0x5297,0x5298,/* 0xA8-0xAF */ 0x5299,0x529A,0x529C,0x52A4,0x52A5,0x52A6,0x52A7,0x52AE,/* 0xB0-0xB7 */ 0x52AF,0x52B0,0x52B4,0x52B5,0x52B6,0x52B7,0x52B8,0x52B9,/* 0xB8-0xBF */ 0x52BA,0x52BB,0x52BC,0x52BD,0x52C0,0x52C1,0x52C2,0x52C4,/* 0xC0-0xC7 */ 0x52C5,0x52C6,0x52C8,0x52CA,0x52CC,0x52CD,0x52CE,0x52CF,/* 0xC8-0xCF */ 0x52D1,0x52D3,0x52D4,0x52D5,0x52D7,0x52D9,0x52DA,0x52DB,/* 0xD0-0xD7 */ - 0x52DC,0x52DD,0xF92F,0x52E0,0x52E1,0x52E2,0x52E3,0x52E5,/* 0xD8-0xDF */ + 0x52DC,0x52DD,0x52DE,0x52E0,0x52E1,0x52E2,0x52E3,0x52E5,/* 0xD8-0xDF */ 0x52E6,0x52E7,0x52E8,0x52E9,0x52EA,0x52EB,0x52EC,0x52ED,/* 0xE0-0xE7 */ - 0x52EE,0x52EF,0x52F1,0x52F2,0x52F3,0x52F4,0xF97F,0x52F6,/* 0xE8-0xEF */ + 0x52EE,0x52EF,0x52F1,0x52F2,0x52F3,0x52F4,0x52F5,0x52F6,/* 0xE8-0xEF */ 0x52F7,0x52F8,0x52FB,0x52FC,0x52FD,0x5301,0x5302,0x5303,/* 0xF0-0xF7 */ 0x5304,0x5307,0x5309,0x530A,0x530B,0x530C,0x530E,0x0000,/* 0xF8-0xFF */ }; @@ -179,12 +181,12 @@ 0x539B,0x539C,0x539E,0x53A0,0x53A1,0x53A4,0x53A7,0x53AA,/* 0x88-0x8F */ 0x53AB,0x53AC,0x53AD,0x53AF,0x53B0,0x53B1,0x53B2,0x53B3,/* 0x90-0x97 */ 0x53B4,0x53B5,0x53B7,0x53B8,0x53B9,0x53BA,0x53BC,0x53BD,/* 0x98-0x9F */ - 0x53BE,0x53C0,0xF96B,0x53C4,0x53C5,0x53C6,0x53C7,0x53CE,/* 0xA0-0xA7 */ + 0x53BE,0x53C0,0x53C3,0x53C4,0x53C5,0x53C6,0x53C7,0x53CE,/* 0xA0-0xA7 */ 0x53CF,0x53D0,0x53D2,0x53D3,0x53D5,0x53DA,0x53DC,0x53DD,/* 0xA8-0xAF */ 0x53DE,0x53E1,0x53E2,0x53E7,0x53F4,0x53FA,0x53FE,0x53FF,/* 0xB0-0xB7 */ 0x5400,0x5402,0x5405,0x5407,0x540B,0x5414,0x5418,0x5419,/* 0xB8-0xBF */ 0x541A,0x541C,0x5422,0x5424,0x5425,0x542A,0x5430,0x5433,/* 0xC0-0xC7 */ - 0x5436,0x5437,0x543A,0x543D,0x543F,0x5441,0xF980,0x5444,/* 0xC8-0xCF */ + 0x5436,0x5437,0x543A,0x543D,0x543F,0x5441,0x5442,0x5444,/* 0xC8-0xCF */ 0x5445,0x5447,0x5449,0x544C,0x544D,0x544E,0x544F,0x5451,/* 0xD0-0xD7 */ 0x545A,0x545D,0x545E,0x545F,0x5460,0x5461,0x5463,0x5465,/* 0xD8-0xDF */ 0x5467,0x5469,0x546A,0x546B,0x546C,0x546D,0x546E,0x546F,/* 0xE0-0xE7 */ @@ -312,7 +314,7 @@ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x38-0x3F */ 0x583E,0x583F,0x5840,0x5841,0x5842,0x5843,0x5845,0x5846,/* 0x40-0x47 */ 0x5847,0x5848,0x5849,0x584A,0x584B,0x584E,0x584F,0x5850,/* 0x48-0x4F */ - 0x5852,0x5853,0x5855,0x5856,0x5857,0x5859,0xFA10,0x585B,/* 0x50-0x57 */ + 0x5852,0x5853,0x5855,0x5856,0x5857,0x5859,0x585A,0x585B,/* 0x50-0x57 */ 0x585C,0x585D,0x585F,0x5860,0x5861,0x5862,0x5863,0x5864,/* 0x58-0x5F */ 0x5866,0x5867,0x5868,0x5869,0x586A,0x586D,0x586E,0x586F,/* 0x60-0x67 */ 0x5870,0x5871,0x5872,0x5873,0x5874,0x5875,0x5876,0x5877,/* 0x68-0x6F */ @@ -326,8 +328,8 @@ 0x58B5,0x58B6,0x58B7,0x58B8,0x58B9,0x58BA,0x58BB,0x58BD,/* 0xA0-0xA7 */ 0x58BE,0x58BF,0x58C0,0x58C2,0x58C3,0x58C4,0x58C6,0x58C7,/* 0xA8-0xAF */ 0x58C8,0x58C9,0x58CA,0x58CB,0x58CC,0x58CD,0x58CE,0x58CF,/* 0xB0-0xB7 */ - 0x58D0,0x58D2,0x58D3,0x58D4,0x58D6,0x58D7,0xF94A,0x58D9,/* 0xB8-0xBF */ - 0x58DA,0x58DB,0x58DC,0x58DD,0x58DE,0xF942,0x58E0,0x58E1,/* 0xC0-0xC7 */ + 0x58D0,0x58D2,0x58D3,0x58D4,0x58D6,0x58D7,0x58D8,0x58D9,/* 0xB8-0xBF */ + 0x58DA,0x58DB,0x58DC,0x58DD,0x58DE,0x58DF,0x58E0,0x58E1,/* 0xC0-0xC7 */ 0x58E2,0x58E3,0x58E5,0x58E6,0x58E7,0x58E8,0x58E9,0x58EA,/* 0xC8-0xCF */ 0x58ED,0x58EF,0x58F1,0x58F2,0x58F4,0x58F5,0x58F7,0x58F8,/* 0xD0-0xD7 */ 0x58FA,0x58FB,0x58FC,0x58FD,0x58FE,0x58FF,0x5900,0x5901,/* 0xD8-0xDF */ @@ -428,7 +430,7 @@ 0x5BC8,0x5BC9,0x5BCA,0x5BCB,0x5BCD,0x5BCE,0x5BCF,0x0000,/* 0x78-0x7F */ 0x5BD1,0x5BD4,0x5BD5,0x5BD6,0x5BD7,0x5BD8,0x5BD9,0x5BDA,/* 0x80-0x87 */ - 0x5BDB,0x5BDC,0x5BE0,0x5BE2,0x5BE3,0x5BE6,0xF9AA,0x5BE9,/* 0x88-0x8F */ + 0x5BDB,0x5BDC,0x5BE0,0x5BE2,0x5BE3,0x5BE6,0x5BE7,0x5BE9,/* 0x88-0x8F */ 0x5BEA,0x5BEB,0x5BEC,0x5BED,0x5BEF,0x5BF1,0x5BF2,0x5BF3,/* 0x90-0x97 */ 0x5BF4,0x5BF5,0x5BF6,0x5BF7,0x5BFD,0x5BFE,0x5C00,0x5C02,/* 0x98-0x9F */ 0x5C03,0x5C05,0x5C07,0x5C08,0x5C0B,0x5C0C,0x5C0D,0x5C0E,/* 0xA0-0xA7 */ @@ -437,7 +439,7 @@ 0x5C2D,0x5C2E,0x5C2F,0x5C30,0x5C32,0x5C33,0x5C35,0x5C36,/* 0xB8-0xBF */ 0x5C37,0x5C43,0x5C44,0x5C46,0x5C47,0x5C4C,0x5C4D,0x5C52,/* 0xC0-0xC7 */ 0x5C53,0x5C54,0x5C56,0x5C57,0x5C58,0x5C5A,0x5C5B,0x5C5C,/* 0xC8-0xCF */ - 0x5C5D,0x5C5F,0xF94B,0x5C64,0x5C67,0x5C68,0x5C69,0x5C6A,/* 0xD0-0xD7 */ + 0x5C5D,0x5C5F,0x5C62,0x5C64,0x5C67,0x5C68,0x5C69,0x5C6A,/* 0xD0-0xD7 */ 0x5C6B,0x5C6C,0x5C6D,0x5C70,0x5C72,0x5C73,0x5C74,0x5C75,/* 0xD8-0xDF */ 0x5C76,0x5C77,0x5C78,0x5C7B,0x5C7C,0x5C7D,0x5C7E,0x5C80,/* 0xE0-0xE7 */ 0x5C83,0x5C84,0x5C85,0x5C86,0x5C87,0x5C89,0x5C8A,0x5C8B,/* 0xE8-0xEF */ @@ -465,12 +467,12 @@ 0x5D01,0x5D04,0x5D05,0x5D08,0x5D09,0x5D0A,0x5D0B,0x5D0C,/* 0x80-0x87 */ 0x5D0D,0x5D0F,0x5D10,0x5D11,0x5D12,0x5D13,0x5D15,0x5D17,/* 0x88-0x8F */ - 0x5D18,0xF9D5,0x5D1A,0x5D1C,0x5D1D,0x5D1F,0x5D20,0x5D21,/* 0x90-0x97 */ + 0x5D18,0x5D19,0x5D1A,0x5D1C,0x5D1D,0x5D1F,0x5D20,0x5D21,/* 0x90-0x97 */ 0x5D22,0x5D23,0x5D25,0x5D28,0x5D2A,0x5D2B,0x5D2C,0x5D2F,/* 0x98-0x9F */ 0x5D30,0x5D31,0x5D32,0x5D33,0x5D35,0x5D36,0x5D37,0x5D38,/* 0xA0-0xA7 */ 0x5D39,0x5D3A,0x5D3B,0x5D3C,0x5D3F,0x5D40,0x5D41,0x5D42,/* 0xA8-0xAF */ 0x5D43,0x5D44,0x5D45,0x5D46,0x5D48,0x5D49,0x5D4D,0x5D4E,/* 0xB0-0xB7 */ - 0x5D4F,0xF921,0x5D51,0x5D52,0x5D53,0x5D54,0x5D55,0x5D56,/* 0xB8-0xBF */ + 0x5D4F,0x5D50,0x5D51,0x5D52,0x5D53,0x5D54,0x5D55,0x5D56,/* 0xB8-0xBF */ 0x5D57,0x5D59,0x5D5A,0x5D5C,0x5D5E,0x5D5F,0x5D60,0x5D61,/* 0xC0-0xC7 */ 0x5D62,0x5D63,0x5D64,0x5D65,0x5D66,0x5D67,0x5D68,0x5D6A,/* 0xC8-0xCF */ 0x5D6D,0x5D6E,0x5D70,0x5D71,0x5D72,0x5D73,0x5D75,0x5D76,/* 0xD0-0xD7 */ @@ -493,7 +495,7 @@ 0x5DA1,0x5DA2,0x5DA3,0x5DA4,0x5DA5,0x5DA6,0x5DA7,0x5DA8,/* 0x40-0x47 */ 0x5DA9,0x5DAA,0x5DAB,0x5DAC,0x5DAD,0x5DAE,0x5DAF,0x5DB0,/* 0x48-0x4F */ 0x5DB1,0x5DB2,0x5DB3,0x5DB4,0x5DB5,0x5DB6,0x5DB8,0x5DB9,/* 0x50-0x57 */ - 0xF9AB,0x5DBB,0x5DBC,0x5DBD,0x5DBE,0x5DBF,0x5DC0,0x5DC1,/* 0x58-0x5F */ + 0x5DBA,0x5DBB,0x5DBC,0x5DBD,0x5DBE,0x5DBF,0x5DC0,0x5DC1,/* 0x58-0x5F */ 0x5DC2,0x5DC3,0x5DC4,0x5DC6,0x5DC7,0x5DC8,0x5DC9,0x5DCA,/* 0x60-0x67 */ 0x5DCB,0x5DCC,0x5DCE,0x5DCF,0x5DD0,0x5DD1,0x5DD2,0x5DD3,/* 0x68-0x6F */ 0x5DD4,0x5DD5,0x5DD6,0x5DD7,0x5DD8,0x5DD9,0x5DDA,0x5DDC,/* 0x70-0x77 */ @@ -529,7 +531,7 @@ 0x5EC6,0x5EC7,0x5EC8,0x5ECB,0x5ECC,0x5ECD,0x5ECE,0x5ECF,/* 0x40-0x47 */ 0x5ED0,0x5ED4,0x5ED5,0x5ED7,0x5ED8,0x5ED9,0x5EDA,0x5EDC,/* 0x48-0x4F */ 0x5EDD,0x5EDE,0x5EDF,0x5EE0,0x5EE1,0x5EE2,0x5EE3,0x5EE4,/* 0x50-0x57 */ - 0x5EE5,0x5EE6,0x5EE7,0x5EE9,0x5EEB,0xF982,0x5EED,0x5EEE,/* 0x58-0x5F */ + 0x5EE5,0x5EE6,0x5EE7,0x5EE9,0x5EEB,0x5EEC,0x5EED,0x5EEE,/* 0x58-0x5F */ 0x5EEF,0x5EF0,0x5EF1,0x5EF2,0x5EF3,0x5EF5,0x5EF8,0x5EF9,/* 0x60-0x67 */ 0x5EFB,0x5EFC,0x5EFD,0x5F05,0x5F06,0x5F07,0x5F09,0x5F0C,/* 0x68-0x6F */ 0x5F0D,0x5F0E,0x5F10,0x5F12,0x5F14,0x5F16,0x5F19,0x5F1A,/* 0x70-0x77 */ @@ -544,7 +546,7 @@ 0x5F74,0x5F75,0x5F76,0x5F78,0x5F7A,0x5F7D,0x5F7E,0x5F7F,/* 0xB0-0xB7 */ 0x5F83,0x5F86,0x5F8D,0x5F8E,0x5F8F,0x5F91,0x5F93,0x5F94,/* 0xB8-0xBF */ 0x5F96,0x5F9A,0x5F9B,0x5F9D,0x5F9E,0x5F9F,0x5FA0,0x5FA2,/* 0xC0-0xC7 */ - 0x5FA3,0x5FA4,0x5FA5,0x5FA6,0x5FA7,0xF966,0x5FAB,0x5FAC,/* 0xC8-0xCF */ + 0x5FA3,0x5FA4,0x5FA5,0x5FA6,0x5FA7,0x5FA9,0x5FAB,0x5FAC,/* 0xC8-0xCF */ 0x5FAF,0x5FB0,0x5FB1,0x5FB2,0x5FB3,0x5FB4,0x5FB6,0x5FB8,/* 0xD0-0xD7 */ 0x5FB9,0x5FBA,0x5FBB,0x5FBE,0x5FBF,0x5FC0,0x5FC1,0x5FC2,/* 0xD8-0xDF */ 0x5FC7,0x5FC8,0x5FCA,0x5FCB,0x5FCE,0x5FD3,0x5FD4,0x5FD5,/* 0xE0-0xE7 */ @@ -578,7 +580,7 @@ 0x60B9,0x60BA,0x60BD,0x60BE,0x60BF,0x60C0,0x60C1,0x60C2,/* 0xA0-0xA7 */ 0x60C3,0x60C4,0x60C7,0x60C8,0x60C9,0x60CC,0x60CD,0x60CE,/* 0xA8-0xAF */ 0x60CF,0x60D0,0x60D2,0x60D3,0x60D4,0x60D6,0x60D7,0x60D9,/* 0xB0-0xB7 */ - 0x60DB,0x60DE,0xF9B9,0x60E2,0x60E3,0x60E4,0x60E5,0x60EA,/* 0xB8-0xBF */ + 0x60DB,0x60DE,0x60E1,0x60E2,0x60E3,0x60E4,0x60E5,0x60EA,/* 0xB8-0xBF */ 0x60F1,0x60F2,0x60F5,0x60F7,0x60F8,0x60FB,0x60FC,0x60FD,/* 0xC0-0xC7 */ 0x60FE,0x60FF,0x6102,0x6103,0x6104,0x6105,0x6107,0x610A,/* 0xC8-0xCF */ 0x610B,0x610C,0x6110,0x6111,0x6112,0x6113,0x6114,0x6116,/* 0xD0-0xD7 */ @@ -586,7 +588,7 @@ 0x6122,0x6125,0x6128,0x6129,0x612A,0x612C,0x612D,0x612E,/* 0xE0-0xE7 */ 0x612F,0x6130,0x6131,0x6132,0x6133,0x6134,0x6135,0x6136,/* 0xE8-0xEF */ 0x6137,0x6138,0x6139,0x613A,0x613B,0x613C,0x613D,0x613E,/* 0xF0-0xF7 */ - 0x6140,0x6141,0x6142,0x6143,0xF9D9,0x6145,0x6146,0x0000,/* 0xF8-0xFF */ + 0x6140,0x6141,0x6142,0x6143,0x6144,0x6145,0x6146,0x0000,/* 0xF8-0xFF */ }; static wchar_t c2u_91[256] = { @@ -605,7 +607,7 @@ 0x6172,0x6173,0x6174,0x6176,0x6178,0x6179,0x617A,0x617B,/* 0x60-0x67 */ 0x617C,0x617D,0x617E,0x617F,0x6180,0x6181,0x6182,0x6183,/* 0x68-0x6F */ 0x6184,0x6185,0x6186,0x6187,0x6188,0x6189,0x618A,0x618C,/* 0x70-0x77 */ - 0x618D,0x618F,0xF98F,0x6191,0x6192,0x6193,0x6195,0x0000,/* 0x78-0x7F */ + 0x618D,0x618F,0x6190,0x6191,0x6192,0x6193,0x6195,0x0000,/* 0x78-0x7F */ 0x6196,0x6197,0x6198,0x6199,0x619A,0x619B,0x619C,0x619E,/* 0x80-0x87 */ 0x619F,0x61A0,0x61A1,0x61A2,0x61A3,0x61A4,0x61A5,0x61A6,/* 0x88-0x8F */ @@ -617,8 +619,8 @@ 0x61DC,0x61DD,0x61DE,0x61DF,0x61E0,0x61E1,0x61E2,0x61E3,/* 0xB8-0xBF */ 0x61E4,0x61E5,0x61E7,0x61E8,0x61E9,0x61EA,0x61EB,0x61EC,/* 0xC0-0xC7 */ 0x61ED,0x61EE,0x61EF,0x61F0,0x61F1,0x61F2,0x61F3,0x61F4,/* 0xC8-0xCF */ - 0xF90D,0x61F7