summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/distro/openslug-packages.conf2
-rw-r--r--conf/distro/unslung.conf15
-rw-r--r--packages/cdstatus/cdstatus-0.96.05.bb4
-rw-r--r--packages/groff/groff/Makefile.in.patch31
-rw-r--r--packages/groff/groff/Makefile.sub.patch21
-rw-r--r--packages/groff/groff_1.19.2.bb23
-rw-r--r--packages/linux/unslung-kernel/defconfig18
-rw-r--r--packages/linux/unslung-kernel/linux-kernel-R29_to_R63.patch6399
-rw-r--r--packages/linux/unslung-kernel_2.4.22.l2.3r63.bb24
-rw-r--r--packages/meta/unslung-image.bb4
-rwxr-xr-xpackages/nslu2-binary-only/unslung-rootfs/unsling12
-rw-r--r--packages/nslu2-binary-only/unslung-rootfs_2.3r63.bb2
12 files changed, 6506 insertions, 49 deletions
diff --git a/conf/distro/openslug-packages.conf b/conf/distro/openslug-packages.conf
index ea126d9032..0c743ef64f 100644
--- a/conf/distro/openslug-packages.conf
+++ b/conf/distro/openslug-packages.conf
@@ -58,6 +58,7 @@ ${PKGDIR}/packages/glibc/*.bb \
${PKGDIR}/packages/gnu-config/*.bb \
${PKGDIR}/packages/gphoto2/*.bb \
${PKGDIR}/packages/grep/*.bb \
+${PKGDIR}/packages/groff/*.bb \
${PKGDIR}/packages/gtk-doc/*.bb \
${PKGDIR}/packages/gzip/*.bb \
${PKGDIR}/packages/hal/*.bb \
@@ -84,6 +85,7 @@ ${PKGDIR}/packages/libdvb/*.bb \
${PKGDIR}/packages/libexif/*.bb \
${PKGDIR}/packages/libgphoto2/*.bb \
${PKGDIR}/packages/libgsm/*.bb \
+${PKGDIR}/packages/libiconv/*.bb \
${PKGDIR}/packages/libid3tag/*.bb \
${PKGDIR}/packages/liblockfile/*.bb \
${PKGDIR}/packages/libmad/*.bb \
diff --git a/conf/distro/unslung.conf b/conf/distro/unslung.conf
index 22b041f521..1777135a0d 100644
--- a/conf/distro/unslung.conf
+++ b/conf/distro/unslung.conf
@@ -3,11 +3,11 @@
#@DESCRIPTION: Unslung Linux Distribution for the NSLU2
DISTRO_NAME = "Unslung"
-DISTRO_VERSION = "5.6-beta"
+DISTRO_VERSION = "6.2-alpha"
DISTRO_TYPE = "beta"
FEED_URIS = "cross##http://ipkg.nslu2-linux.org/feeds/optware/nslu2/cross/stable"
-FEED_URIS += "native##http://ipkg.nslu2-linux.org/feeds/optware/nslu2/cross/stable"
+FEED_URIS += "native##http://ipkg.nslu2-linux.org/feeds/optware/nslu2/native/stable"
FEED_URIS += "oe##http://ipkg.nslu2-linux.org/feeds/unslung/modules/cross/stable"
# pull in the frozen list of bbfiles
@@ -57,8 +57,9 @@ PREFERRED_VERSION_glibc-initial ?= "2.2.5"
PREFERRED_VERSION_binutils ?= "2.15.94.0.1"
PREFERRED_VERSION_binutils-cross ?= "2.15.94.0.1"
-PREFERRED_VERSION_unslung-kernel ?= "2.4.22.l2.3r29"
-PREFERRED_VERSION_unslung-rootfs ?= "2.3r29"
-PREFERRED_VERSION_nslu2-linksys-firmware ?= "2.3r29"
-PREFERRED_VERSION_nslu2-linksys-libs ?= "2.3r29"
-PREFERRED_VERSION_nslu2-linksys-ramdisk ?= "2.3r29"
+PREFERRED_PROVIDER_virtual/kernel ?= "unslung-kernel"
+PREFERRED_VERSION_unslung-kernel ?= "2.4.22.l2.3r63"
+PREFERRED_VERSION_unslung-rootfs ?= "2.3r63"
+PREFERRED_VERSION_nslu2-linksys-firmware ?= "2.3r63"
+PREFERRED_VERSION_nslu2-linksys-libs ?= "2.3r63"
+PREFERRED_VERSION_nslu2-linksys-ramdisk ?= "2.3r63"
diff --git a/packages/cdstatus/cdstatus-0.96.05.bb b/packages/cdstatus/cdstatus-0.96.05.bb
index 1ae728f836..a2b3a0484a 100644
--- a/packages/cdstatus/cdstatus-0.96.05.bb
+++ b/packages/cdstatus/cdstatus-0.96.05.bb
@@ -1,6 +1,6 @@
# cdstatus OE build file
-PR="r0"
+PR="r1"
LICENSE="GPL"
HOMEPAGE = "http://cdstatus.sourceforge.net/"
FILES_${PN} += ${datadir}/cdstatus.cfg
@@ -12,8 +12,6 @@ S="${WORKDIR}/cdstatus-0.96.05"
inherit autotools
-TARGET_LDFLAGS=""
-
do_install() {
install -d 0755 ${D}/${bindir}
install -d 0755 ${D}/${datadir}
diff --git a/packages/groff/groff/Makefile.in.patch b/packages/groff/groff/Makefile.in.patch
new file mode 100644
index 0000000000..30aac8cbf0
--- /dev/null
+++ b/packages/groff/groff/Makefile.in.patch
@@ -0,0 +1,31 @@
+*** groff-1.19.2/Makefile.in.orig Sun Aug 7 10:03:33 2005
+--- groff-1.19.2/Makefile.in Sat Dec 3 16:44:50 2005
+***************
+*** 242,249 ****
+
+ # The configure script checks whether all necessary utility programs for
+ # grohtml are available -- only then we can build the HTML documentation.
+! make_html=@make_html@
+! make_install_html=@make_install_html@
+
+ # The configure script also checks whether all necessary utility programs
+ # for pdfroff are available -- only then we can build PDF documentation.
+--- 242,249 ----
+
+ # The configure script checks whether all necessary utility programs for
+ # grohtml are available -- only then we can build the HTML documentation.
+! make_html=
+! make_install_html=
+
+ # The configure script also checks whether all necessary utility programs
+ # for pdfroff are available -- only then we can build PDF documentation.
+***************
+*** 549,555 ****
+ contrib/pic2graph \
+ contrib/eqn2graph \
+ contrib/grap2graph \
+- contrib/groffer \
+ contrib/mom \
+ contrib/pdfmark \
+ contrib/gdiffmk
+--- 549,554 ----
diff --git a/packages/groff/groff/Makefile.sub.patch b/packages/groff/groff/Makefile.sub.patch
new file mode 100644
index 0000000000..1b5a7dfac5
--- /dev/null
+++ b/packages/groff/groff/Makefile.sub.patch
@@ -0,0 +1,21 @@
+*** groff-1.19.2/src/include/Makefile.sub.orig Thu Jun 23 13:27:53 2005
+--- groff-1.19.2/src/include/Makefile.sub Sat Dec 3 18:35:40 2005
+***************
+*** 39,46 ****
+ "DEVICE=\"$(DEVICE)\"" \
+ "INSTALLPATH=\"$(prefix)\"" \
+ "BINPATH=\"$(bindir)\"" \
+! "FONTPATH=\"$(fontpath)\"" \
+! "MACROPATH=\"$(tmacpath)\"" \
+ "INDEX_SUFFIX=\"$(indexext)\"" \
+ "COMMON_WORDS_FILE=\"$(common_words_file)\"" \
+ "DEFAULT_INDEX_DIR=\"$(indexdir)\"" \
+--- 39,46 ----
+ "DEVICE=\"$(DEVICE)\"" \
+ "INSTALLPATH=\"$(prefix)\"" \
+ "BINPATH=\"$(bindir)\"" \
+! "FONTPATH=\"/usr/share/groff/site-font:/usr/share/groff/1.19.2/font:/usr/lib/font\"" \
+! "MACROPATH=\"/usr/lib/groff/site-tmac:/usr/share/groff/site-tmac:/usr/share/groff/1.19.2/tmac\"" \
+ "INDEX_SUFFIX=\"$(indexext)\"" \
+ "COMMON_WORDS_FILE=\"$(common_words_file)\"" \
+ "DEFAULT_INDEX_DIR=\"$(indexdir)\"" \
diff --git a/packages/groff/groff_1.19.2.bb b/packages/groff/groff_1.19.2.bb
new file mode 100644
index 0000000000..7381bb3687
--- /dev/null
+++ b/packages/groff/groff_1.19.2.bb
@@ -0,0 +1,23 @@
+LICENSE = "GPL"
+SECTION = "base"
+DESCRIPTION = "GNU roff"
+RDEPENDS="libstdc++6"
+MAINTAINER = "Inge Arnesen <inge.arnesen@gmail.com>"
+SRC_URI = "http://ftp.gnu.org/gnu/groff/groff-${PV}.tar.gz \
+ file://Makefile.in.patch;patch=1 \
+ file://Makefile.sub.patch;patch=1 \
+ file://groff.patch;patch=1"
+
+# prefix and exec-prefix are broken and the .in file is broken too
+# and can't be autoreconf'ed, so specify every dir
+EXTRA_OECONF="--prefix=${D} --exec-prefix=${D} --bindir=${D}/usr/bin --datadir=${D}/usr/share --mandir=${D}/usr/man --infodir=${D}/usr/share/info"
+inherit autotools
+
+do_configure () {
+ oe_runconf
+}
+
+#do_install() {
+# oe_runmake 'PREFIX=${D}' install
+#}
+
diff --git a/packages/linux/unslung-kernel/defconfig b/packages/linux/unslung-kernel/defconfig
index d9a01070d5..110728b68e 100644
--- a/packages/linux/unslung-kernel/defconfig
+++ b/packages/linux/unslung-kernel/defconfig
@@ -982,24 +982,24 @@ CONFIG_NLS=y
# Native Language Support
#
CONFIG_NLS_DEFAULT="iso8859-1"
-# CONFIG_NLS_CODEPAGE_437 is not set
-# CONFIG_NLS_CODEPAGE_737 is not set
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
# CONFIG_NLS_CODEPAGE_775 is not set
-# CONFIG_NLS_CODEPAGE_850 is not set
-# CONFIG_NLS_CODEPAGE_852 is not set
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
# CONFIG_NLS_CODEPAGE_855 is not set
# CONFIG_NLS_CODEPAGE_857 is not set
# CONFIG_NLS_CODEPAGE_860 is not set
-# CONFIG_NLS_CODEPAGE_861 is not set
+CONFIG_NLS_CODEPAGE_861=m
# CONFIG_NLS_CODEPAGE_862 is not set
# CONFIG_NLS_CODEPAGE_863 is not set
# CONFIG_NLS_CODEPAGE_864 is not set
# CONFIG_NLS_CODEPAGE_865 is not set
-# CONFIG_NLS_CODEPAGE_866 is not set
+CONFIG_NLS_CODEPAGE_866=m
# CONFIG_NLS_CODEPAGE_869 is not set
-# CONFIG_NLS_CODEPAGE_936 is not set
-# CONFIG_NLS_CODEPAGE_950 is not set
-# CONFIG_NLS_CODEPAGE_932 is not set
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
# CONFIG_NLS_CODEPAGE_949 is not set
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
diff --git a/packages/linux/unslung-kernel/linux-kernel-R29_to_R63.patch b/packages/linux/unslung-kernel/linux-kernel-R29_to_R63.patch
new file mode 100644
index 0000000000..cf1c83efbe
--- /dev/null
+++ b/packages/linux/unslung-kernel/linux-kernel-R29_to_R63.patch
@@ -0,0 +1,6399 @@
+--- 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 <linux/unistd.h>
+-
++//pete
++#include <linux/sched.h>
++#include <linux/completion.h>
++//
+ #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 <linux/genhd.h>
+
++//pete
++#include <linux/completion.h>
++//
++
+ /*
+ * 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(&current->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(&current->files->count);
++ daemonize();
++ reparent_to_init();
++
++ /* avoid getting signals */
++ spin_lock_irq(&current->sigmask_lock);
++ flush_signals(current);
++ sigfillset(&current->blocked);
++ recalc_sigpending(current);
++ spin_unlock_irq(&current->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 <linux/config.h>
+@@ -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 <linux/usb.h>
+ #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 @@