]> git.neil.brown.name Git - history.git/commitdiff
Import 1.2.10 1.2.10
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:09:59 +0000 (15:09 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:09:59 +0000 (15:09 -0500)
16 files changed:
Makefile
drivers/block/Makefile
drivers/block/README.ide
drivers/block/README.sbpcd
drivers/block/README.sonycd535
drivers/block/sbpcd.c
drivers/block/sonycd535.c
drivers/char/cyclades.c
drivers/scsi/fdomain.c
drivers/scsi/st.c
fs/binfmt_elf.c
include/linux/elf.h
include/linux/sbpcd.h
include/linux/tcp.h
net/inet/af_inet.c
net/inet/ip_fw.c

index 19379b8895794d890514e0942191ad2216b5374c..2f2c17ea9c9f2b7156216185afe21d6d9fab26b6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 1
 PATCHLEVEL = 2
-SUBLEVEL = 9
+SUBLEVEL = 10
 
 ARCH = i386
 
index 140bc31a992f724f290ce2dbc6b33829ac300b96..6a846f94862ec3c67d9fa2d42b88ac48221ab017 100644 (file)
@@ -100,6 +100,9 @@ block.a: $(OBJS)
 
 dep:
        $(CPP) -M $(SRCS) > .depend
+ifdef BLOCK_MODULE_OBJS
+       $(CPP) -M -DMODULE $(BLOCK_MODULE_OBJS:.o=.c) >> .depend
+endif
 
 modules: $(BLOCK_MODULE_OBJS)
        echo $(BLOCK_MODULE_OBJS) > ../../modules/BLOCK_MODULES
index b6dd867ee76ae79033ad0c136e514aca0728104e..39ae4fa79f04ec94ba95cc13f02b1aa1bd150bad 100644 (file)
@@ -25,7 +25,7 @@ NEW!  - support for reliable operation of buggy CMD-640 interfaces
                - use kernel command line option:   hda=serialize
 NEW!   - experimental support for DTC-2278D interfaces
                - use kernel command line option:  hda=dtc2278
-NEW!   - run-time selectible 32bit interface support (using hdparm-2.3)
+NEW!   - run-time selectable 32bit interface support (using hdparm-2.3)
 
 Under construction:
 
index f78b9517e3bc1b7ceb6867f62320bb1f698ca8f1..6a40abfb0634a8b51a6ad93c62c34d3f9642ca3c 100644 (file)
@@ -1,9 +1,9 @@
-This README belongs to release 3.5 or newer of the SoundBlaster Pro
-(Matsushita, Kotobuki, Panasonic, CreativeLabs, Longshine and soon TEAC, too)
+This README belongs to release 3.7 or newer of the SoundBlaster Pro
+(Matsushita, Kotobuki, Panasonic, CreativeLabs, Longshine and TEAC)
 CD-ROM driver for Linux.
 
 The driver is able to drive the whole family of "traditional" IDE-style (that
-has nothing to do with the new "Enhanced IDE" drive standard) Matsushita,
+is NOT the new "Enhanced IDE" or "ATAPI" drive standard) Matsushita,
 Kotobuki, Panasonic drives, sometimes labelled as "CreativeLabs". The
 well-known drives are CR-521, CR-522, CR-523, CR-562, CR-563.
 
@@ -42,6 +42,10 @@ work.
 The interface type has to get configured in /usr/include/linux/sbpcd.h, 
 because the behavior of some sound card interfaces is different.
 
+With some TEAC drives I have seen interface cards which seem to lack the
+"drive select" lines; always drive 0 gets addressed. To avoid "mirror drives"
+with such interface cards, set MAX_DRIVES to 1 and jumper your drive to ID 0.
+
 The driver respects all known drive firmware releases - my old drive is a 2.11,
 but it should work with CR-52x drives <2.01 ... >3.00 and with CR-56x drives
 <0.75 .. 5.00.
@@ -79,9 +83,8 @@ The audio part should run with WorkMan, xcdplayer, with the "non-X11" products
 CDplayer and WorkBone - tell me if it is not compatible with other software.
 
 With the CR-562 and CR-563 drives, the reading of audio frames is possible.
-This is implemented by an IOCTL function which per default reads only up to
-4 frames of 2352 bytes at once (configurable with the "READ_AUDIO" define,
-"55" is the maximum if you use sbpcd as a "module").
+This is implemented by an IOCTL function which reads READ_AUDIO frames of
+2352 bytes at once (configurable with the "READ_AUDIO" define, default is 0).
 Reading the same frame a second time gives different data; the frame data 
 start at a different position, but all read bytes are valid, and we always
 read 98 consecutive chunks (of 24 Bytes) as a frame. Reading more than 1 frame
@@ -89,8 +92,8 @@ at once possibly misses some chunks at each frame boundary. This lack has to
 get corrected by external, "higher level" software which reads the same frame 
 again and tries to find and eliminate overlapping chunks (24-byte-pieces).
 
-The transfer rate with reading audio (1-frame-pieces) is as slow as 32 kB/sec.
-This could be better reading bigger chunks, but the "missing" chunks possibly
+The transfer rate with reading audio (1-frame-pieces) currently is very slow.
+This can be better reading bigger chunks, but the "missing" chunks possibly
 occur at the beginning of each single frame.
 The software interface possibly may change a bit the day the SCSI driver
 supports it too.
index 4c6f4da1f152e4352e07b5b37415dc1282fc7d48..ca5c371fdd93e3da1e19dd56af7ff4c0e82c5bd9 100644 (file)
@@ -58,13 +58,17 @@ THANKS
 ======
 
 Many thanks to Ron Jeppesen (ronj.an@site007.saic.com) for getting
-this project off the ground.  He wrote the initial release and
-the first two patches to this driver (0.1, 0.2, and 0.3).
+this project off the ground.  He wrote the initial release
+and the first two patches to this driver (0.1, 0.2, and 0.3).
 Thanks also to Eberhard Moenkeberg (emoenke@gwdg.de) for prodding
-me to place this code into the mainstream Linux source tree (as
-of Linux version 1.1.91), as well as some patches to make it a
-better device citizen.  Further thanks to "S. Joel Katz"
-<stimpson@panix.com> for his MODULE patches (see details below).
+me to place this code into the mainstream Linux source tree
+(as of Linux version 1.1.91), as well as some patches to make
+it a better device citizen.  Further thanks to "S. Joel Katz"
+<stimpson@panix.com> for his MODULE patches (see details below),
+Porfiri Claudio <C.Porfiri@nisms.tei.ericsson.se> for patches
+to make the driver work with the older CDU-510/515 series, and
+Heiko Eissfeldt <heiko@colossus.escape.de> for pointing out that
+the verify_area() checks were ignoring the results of said checks.
 
 (Acknowledgments from Ron Jeppesen in the 0.3 release:)
 Thanks to Corey Minyard who wrote the original CDU-31A driver on which
index b8f7ffcf9147532cf13e6aac02ca87bc7ea3cc56..5f536e941d3a5ec5e5e69b9c5a9e2c20bf67b787 100644 (file)
@@ -11,7 +11,7 @@
  *            Also for the TEAC CD-55A drive.
  *            Not for Funai or Sanyo drives.
  *
- *  NOTE:     This is release 3.6.
+ *  NOTE:     This is release 3.7.
  *
  *  VERSION HISTORY
  *
  *       Initial size of the READ_AUDIO buffer is 0. Can get set to any size
  *       during runtime.
  *
+ *  3.7  Introduced MAX_DRIVES for some poor interface cards (seen with TEAC
+ *       drives) which allow only one drive (ID 0); this avoids repetitive
+ *       detection under IDs 1..3. 
+ *       Elongated cmd_out_T response waiting; necessary for photo CDs with
+ *       a lot of sessions.
+ *       Bettered the sbpcd_open() behavior with TEAC drives.
+ *
  *  TODO
  *
  *     disk change detection
@@ -288,13 +295,7 @@ char kernel_version[]=UTS_RELEASE;
 
 #include "blk.h"
 
-#define VERSION "v3.6-1 Eberhard Moenkeberg <emoenke@gwdg.de>"
-
-#if 0
-#define INLINE
-#else
-#define INLINE inline
-#endif
+#define VERSION "v3.7 Eberhard Moenkeberg <emoenke@gwdg.de>"
 
 /*==========================================================================*/
 /*
@@ -406,6 +407,9 @@ extern unsigned long sbpcd4_init(unsigned long, unsigned long);
 #endif
 
 /*==========================================================================*/
+
+#define INLINE inline
+
 /*==========================================================================*/
 /*
  * the forward references:
@@ -533,8 +537,9 @@ static u_char infobuf[20];
 static u_char xa_head_buf[CD_XA_HEAD];
 static u_char xa_tail_buf[CD_XA_TAIL];
 
+static volatile u_char busy_data=0;
+static volatile u_char busy_audio=0; /* true semaphores would be safer */
 static u_long timeout;
-static u_char busy_data=0, busy_audio=0; /* true semaphores would be safer */
 static volatile u_char timed_out_delay=0;
 static volatile u_char timed_out_data=0;
 #if 0
@@ -1017,21 +1022,29 @@ static int ResponseInfo(void)
                                        st=inb(CDi_status);
                                        if (!(st&s_not_result_ready)) break;
                                }
-                               if (j != 0 || timeout <= jiffies) break;
-                               sbp_sleep(0);
+                               if ((j!=0)||(timeout<=jiffies)) break;
+                               sbp_sleep(1);
                                j = 1;
                        }
-                       if (timeout <= jiffies) break;
+                       if (timeout<=jiffies) break;
                        infobuf[i]=inb(CDi_info);
                }
        }
+#if 000
+       while (!(inb(CDi_status)&s_not_result_ready))
+       {
+               infobuf[i++]=inb(CDi_info);
+       }
+       j=i-response_count;
+       if (j>0) msg(DBG_INF,"ResponseInfo: got %d trailing bytes.\n",j);
+#endif 000
        for (j=0;j<i;j++)
                sprintf(&msgbuf[j*3]," %02X",infobuf[j]);
        msgbuf[j*3]=0;
        msg(DBG_CMD,"ResponseInfo:%s (%d,%d)\n",msgbuf,response_count,i);
-       st=response_count-i;
-       if (st>0) st=-st;
-       return (st);
+       j=response_count-i;
+       if (j>0) return (-j);
+       else return (i);
 }
 /*==========================================================================*/
 static void EvaluateStatus(int st)
@@ -1253,7 +1266,7 @@ static int cc_ReadError(void)
 static int cmd_out_T(void)
 {
 #undef CMDT_TRIES
-#define CMDT_TRIES 100
+#define CMDT_TRIES 1000
        
        static int cc_DriveReset(void);
        int i, j, l, ntries;
@@ -1358,7 +1371,7 @@ static int cmd_out_T(void)
                        return (-D_S[d].error_state-400);
                }
                if (drvcmd[0]==CMDT_READ) return (0); /* handled elsewhere */
-               sbp_sleep(1);
+               sbp_sleep(10);
                if (ntries>(CMDT_TRIES-50)) continue;
                msg(DBG_TEA,"cmd_out_T: next CMDT_TRIES (%02X): %d.\n", drvcmd[0], ntries-1);
        }
@@ -1414,7 +1427,7 @@ static int cmd_out(void)
                if (D_S[d].in_SpinUp) msg(DBG_SPI,"in_SpinUp: to ResponseStatus.\n");
                i=ResponseStatus();
                /* builds status_bits, returns orig. status or p_busy_new */
-               if (i<0) return (-9);
+               if (i<0) return (i);
                if (flags_cmd_out&(f_bit1|f_wait_if_busy))
                {
                        if (!st_check)
@@ -2083,15 +2096,18 @@ static int LockDoor(void)
                sbp_sleep(1);
        }
        while ((i<0)&&(j));
-       if (j==0) cc_DriveReset();
-       j=20;
-       do
-       {
-               i=cc_LockDoor(1);
-               --j;
-               sbp_sleep(1);
+       if (j==0)
+       {               
+               cc_DriveReset();
+               j=20;
+               do
+               {
+                       i=cc_LockDoor(1);
+                       --j;
+                       sbp_sleep(1);
+               }
+               while ((i<0)&&(j));
        }
-       while ((i<0)&&(j));
        return (i);
 }
 /*==========================================================================*/
@@ -2243,7 +2259,7 @@ static int cc_ModeSense(void)
        else if (famT_drive)
        {
                D_S[d].sense_byte=0;
-               if (infobuf[4]==0x01) D_S[d].xa_byte=0x20;
+               if (infobuf[4]==0x01) D_S[d].xa_byte=0x20; /* wrong!!!! */
                i=2;
        }
        D_S[d].frame_size=make16(infobuf[i],infobuf[i+1]);
@@ -3204,7 +3220,7 @@ static int check_version(void)
                        if (D_S[d].firmware_version[j]!=lcs_firm_f4[j]) break;
                if (j==4) D_S[d].drv_type=drv_f4;
 
-               if (!D_S[d].drv_type) ask_mail();
+               if (D_S[d].drv_type==drv_famL) ask_mail();
        }
        else if (famT_drive)
        {
@@ -3382,7 +3398,7 @@ static int check_drives(void)
        
        msg(DBG_INI,"check_drives entered.\n");
        ndrives=0;
-       for (j=0;j<NR_SBPCD;j++)
+       for (j=0;j<MAX_DRIVES;j++)
        {
                D_S[ndrives].drv_id=j;
                if (sbpro_type==1) D_S[ndrives].drv_sel=(j&0x01)<<1|(j&0x02)>>1;
@@ -3624,7 +3640,7 @@ static int DiskInfo(void)
                return (i);
        }
        if (D_S[d].f_multisession) D_S[d].sbp_bufsiz=1;  /* possibly a weird PhotoCD */
-       
+       else D_S[d].sbp_bufsiz=SBP_BUFFER_FRAMES;
        i=cc_ReadTocEntry(D_S[d].n_first_track);
        if (i<0)
        {
@@ -4823,6 +4839,7 @@ static int sbpcd_open(struct inode *ip, struct file *fp)
        {
                cc_DriveReset();
                i=ResponseStatus();
+               i=ResponseStatus();
        }
        if (i<0)
        {
@@ -5065,12 +5082,12 @@ int init_module(void)
                msg(DBG_INF,"Auto-Probing can cause a hang (f.e. touching an ethernet card).\n");
                msg(DBG_INF,"If that happens, you have to reboot and use the\n");
                msg(DBG_INF,"LILO (kernel) command line feature like:\n");
-               msg(DBG_INF,"\n   LILO boot: ... sbpcd=0x230,SoundBlaster\n");
+               msg(DBG_INF,"   LILO boot: ... sbpcd=0x230,SoundBlaster\n");
                msg(DBG_INF,"or like:\n");
                msg(DBG_INF,"   LILO boot: ... sbpcd=0x300,LaserMate\n");
                msg(DBG_INF,"or like:\n");
                msg(DBG_INF,"   LILO boot: ... sbpcd=0x330,SPEA\n");
-               msg(DBG_INF,"\nwith your REAL address.\n");
+               msg(DBG_INF,"with your REAL address.\n");
                msg(DBG_INF,"= = = = = = = = = = END of WARNING = = = = = = = = = =\n\n");
        }
 #endif DISTRIBUTION
@@ -5153,8 +5170,10 @@ int init_module(void)
                
                cc_ReadStatus();
                i=ResponseStatus();  /* returns orig. status or p_busy_new */
+               if (famT_drive) i=ResponseStatus();  /* returns orig. status or p_busy_new */
                if (i<0)
-                       msg(DBG_INF,"init: ResponseStatus returns %02X\n",i);
+                       if (i!=-402)
+                               msg(DBG_INF,"init: ResponseStatus returns %d.\n",i);
                else
                {
                        if (st_check)
index b039257fe23b7fd1348604286d567688b26519e5..0ab6f13aa2ddcfc5a46aaae7d785985faca25364 100644 (file)
  * I tried polling without the sony_sleep during the data transfers but
  * it did not speed things up any.
  *
- *  5/23/93 (rgj) changed the major number to 21 to get rid of conflict
+ * 1993-05-23 (rgj) changed the major number to 21 to get rid of conflict
  * with CDU-31A driver.  This is the also the number from the Linux
  * Device Driver Registry for the Sony Drive.  Hope nobody else is using it.
  *
- *  8/29/93 (rgj) remove the configuring of the interface board address
+ * 1993-08-29 (rgj) remove the configuring of the interface board address
  * from the top level configuration, you have to modify it in this file.
  *
- * 1/26/95 Made module-capable (Joel Katz <Stimpson@Panix.COM>)
+ * 1995-01-26 Made module-capable (Joel Katz <Stimpson@Panix.COM>)
+ *
+ * 1995-05-20
+ *  Modified to support CDU-510/515 series
+ *      (Claudio Porfiri<C.Porfiri@nisms.tei.ericsson.se>)
+ *  Fixed to report verify_area() failures
+ *      (Heiko Eissfeldt <heiko@colossus.escape.de>)
+ *
+ * 1995-06-01
+ *  More chages to support CDU-510/515 series
+ *      (Claudio Porfiri<C.Porfiri@nisms.tei.ericsson.se>)
  *
  * Things to do:
  *  - handle errors and status better, put everything into a single word
 #define MAJOR_NR CDU535_CDROM_MAJOR
 
 #ifdef MODULE
-# include "/usr/src/linux/drivers/block/blk.h"
+# include "blk.h"
 #else
 # include "blk.h"
 # define MOD_INC_USE_COUNT
 # define CDU535_MESSAGE_NAME   "Sony CDU-535"
 #endif
 
+#ifndef MAX_SPINUP_RETRY
+# define MAX_SPINUP_RETRY              3       /* 1 is sufficient for most drives... */
+#endif
+#ifndef RETRY_FOR_BAD_STATUS
+# define RETRY_FOR_BAD_STATUS  100     /* in 10th of second */
+#endif
+
 #ifndef DEBUG
 # define DEBUG 1
 #endif
@@ -811,7 +828,6 @@ do_cdu535_request(void)
        Byte status[2];
        Byte cmd[2];
 
-
        if (!sony_inuse) {
                cdu_open(NULL, NULL);
        }
@@ -870,36 +886,56 @@ do_cdu535_request(void)
 
                                        /*
                                         * Read the data.  If the drive was not spinning,
-                                        * spin it up and try once more.
+                                        * spin it up and try some more.
                                         */
-                                       spin_up_retry = 0;
-                                       for (;;) {
-#if DEBUG > 1
-                                               if (check_drive_status() != 0) {
-                                                       /* drive not ready */
-                                                       sony_first_block = -1;
-                                                       sony_last_block = -1;
-                                                       end_request(0);
-                                                       return;
-                                               }
-#endif
-                                               if (0 <= seek_and_read_N_blocks(params, read_size,
-                                                                       status, sony_buffer, (read_size * 2048)))
+                                       for (spin_up_retry=0 ;; ++spin_up_retry) {
+                                               /* This loop has been modified to support the Sony
+                                                * CDU-510/515 series, thanks to Claudio Porfiri 
+                                                * <C.Porfiri@nisms.tei.ericsson.se>.
+                                                */
+                                               /*
+                                                * This part is to deal with very slow hardware.  We
+                                                * try at most MAX_SPINUP_RETRY times to read the same
+                                                * block.  A check for seek_and_read_N_blocks' result is
+                                                * performed; if the result is wrong, the CDROM's engine
+                                                * is restarted and the operation is tried again.
+                                                */
+                                               /*
+                                                * 1995-06-01: The system got problems when downloading
+                                                * from Slackware CDROM, the problem seems to be:
+                                                * seek_and_read_N_blocks returns BAD_STATUS and we
+                                                * should wait for a while before retrying, so a new
+                                                * part was added to discriminate the return value from
+                                                * seek_and_read_N_blocks for the various cases.
+                                                */
+                                               int readStatus = seek_and_read_N_blocks(params, read_size,
+                                                                       status, sony_buffer, (read_size * 2048));
+                                               if (0 <= readStatus)    /* Good data; common case, placed first */
                                                        break;
-                                               if (!(status[0] & SONY535_STATUS1_NOT_SPINNING) ||
-                                                                                                                       spin_up_retry) {
-                                                       printk(CDU535_MESSAGE_NAME " Read error: 0x%.2x\n",
-                                                                       status[0]);
+                                               if (readStatus == NO_ROOM || spin_up_retry == MAX_SPINUP_RETRY) {
+                                                       /* give up */
+                                                       if (readStatus == NO_ROOM)
+                                                               printk(CDU535_MESSAGE_NAME " No room to read from CD\n");
+                                                       else
+                                                               printk(CDU535_MESSAGE_NAME " Read error: 0x%.2x\n",
+                                                                               status[0]);
                                                        sony_first_block = -1;
                                                        sony_last_block = -1;
                                                        end_request(0);
                                                        return;
                                                }
+                                               if (readStatus == BAD_STATUS) {
+                                                       /* Sleep for a while, then retry */
+                                                       current->state = TASK_INTERRUPTIBLE;
+                                                       current->timeout = jiffies + RETRY_FOR_BAD_STATUS;
+                                                       schedule();
+                                               }
+#if DEBUG > 0
                                                printk(CDU535_MESSAGE_NAME
                                                        " debug: calling spin up when reading data!\n");
+#endif
                                                cmd[0] = SONY535_SPIN_UP;
                                                do_sony_cmd(cmd, 1, status, NULL, 0, 0);
-                                               spin_up_retry = 1;
                                        }
                                }
                                /*
@@ -1008,7 +1044,7 @@ static int
 sony_get_subchnl_info(long arg)
 {
        struct cdrom_subchnl schi;
-
+       int err;
 
        /* Get attention stuff */
        if (check_drive_status() != 0)
@@ -1018,7 +1054,9 @@ sony_get_subchnl_info(long arg)
        if (!sony_toc_read) {
                return -EIO;
        }
-       verify_area(VERIFY_WRITE /* and read */ , (char *)arg, sizeof schi);
+       err = verify_area(VERIFY_WRITE /* and read */ , (char *)arg, sizeof schi);
+       if (err)
+               return err;
 
        memcpy_fromfs(&schi, (char *)arg, sizeof schi);
 
@@ -1079,8 +1117,9 @@ cdu_ioctl(struct inode *inode,
        unsigned int dev;
        Byte status[2];
        Byte cmd_buff[10], params[10];
-       int  i, dsc_status;
-
+       int  i;
+       int  dsc_status;
+       int  err;
 
        if (!inode) {
                return -EINVAL;
@@ -1170,7 +1209,9 @@ cdu_ioctl(struct inode *inode,
                break;
 
        case CDROMPLAYMSF:                      /* Play starting at the given MSF address. */
-               verify_area(VERIFY_READ, (char *)arg, 6);
+               err = verify_area(VERIFY_READ, (char *)arg, 6);
+               if (err)
+                       return err;
                spin_up_drive(status);
                set_drive_mode(SONY535_AUDIO_DRIVE_MODE, status);
                memcpy_fromfs(params, (void *)arg, 6);
@@ -1209,7 +1250,9 @@ cdu_ioctl(struct inode *inode,
                        if (!sony_toc_read)
                                return -EIO;
                        hdr = (struct cdrom_tochdr *)arg;
-                       verify_area(VERIFY_WRITE, hdr, sizeof *hdr);
+                       err = verify_area(VERIFY_WRITE, hdr, sizeof *hdr);
+                       if (err)
+                               return err;
                        loc_hdr.cdth_trk0 = bcd_to_int(sony_toc->first_track_num);
                        loc_hdr.cdth_trk1 = bcd_to_int(sony_toc->last_track_num);
                        memcpy_tofs(hdr, &loc_hdr, sizeof *hdr);
@@ -1229,7 +1272,9 @@ cdu_ioctl(struct inode *inode,
                                return -EIO;
                        }
                        entry = (struct cdrom_tocentry *)arg;
-                       verify_area(VERIFY_WRITE /* and read */ , entry, sizeof *entry);
+                       err = verify_area(VERIFY_WRITE /* and read */ , entry, sizeof *entry);
+                       if (err)
+                               return err;
 
                        memcpy_fromfs(&loc_entry, entry, sizeof loc_entry);
 
@@ -1268,7 +1313,9 @@ cdu_ioctl(struct inode *inode,
                        sony_get_toc();
                        if (!sony_toc_read)
                                return -EIO;
-                       verify_area(VERIFY_READ, (char *)arg, sizeof ti);
+                       err = verify_area(VERIFY_READ, (char *)arg, sizeof ti);
+                       if (err)
+                               return err;
 
                        memcpy_fromfs(&ti, (char *)arg, sizeof ti);
                        if ((ti.cdti_trk0 < sony_toc->first_track_num)
@@ -1337,7 +1384,9 @@ cdu_ioctl(struct inode *inode,
                {
                        struct cdrom_volctrl volctrl;
 
-                       verify_area(VERIFY_READ, (char *)arg, sizeof volctrl);
+                       err = verify_area(VERIFY_READ, (char *)arg, sizeof volctrl);
+                       if (err)
+                               return err;
 
                        memcpy_fromfs(&volctrl, (char *)arg, sizeof volctrl);
                        cmd_buff[0] = SONY535_SET_VOLUME;
index 978b99ee4b6bffafa1e36dc90e58205c535b98de..cbeb31ae0c64a84ad2984b423562140298b84bb6 100644 (file)
@@ -2643,7 +2643,7 @@ cy_init_card(unsigned char *true_base_addr)
 
         /* The Cyclom-16Y does not decode address bit 9 and therefore
            cannot distinguish between references to chip 0 and a non-
-           existent chip 4.  If the preceeding clearing of the supposed
+           existent chip 4.  If the preceding clearing of the supposed
            chip 4 GFRCR register appears at chip 0, there is no chip 4
            and this must be a Cyclom-16Y, not a Cyclom-32Ye.
         */
index 992f7f8b41feddf02459865127345ca03351fc4b..806dc0151de231335ac285811cc12da7604135b9 100644 (file)
@@ -1,10 +1,10 @@
 /* fdomain.c -- Future Domain TMC-16x0 SCSI driver
  * Created: Sun May  3 18:53:19 1992 by faith@cs.unc.edu
- * Revised: Sat Jan 14 21:39:15 1995 by faith@cs.unc.edu
+ * Revised: Mon Jun  5 09:21:54 1995 by faith@cs.unc.edu
  * Author: Rickard E. Faith, faith@cs.unc.edu
  * Copyright 1992, 1993, 1994, 1995 Rickard E. Faith
  *
- * $Id: fdomain.c,v 5.26 1995/01/15 02:39:19 root Exp $
+ * $Id: fdomain.c,v 5.28 1995/06/05 13:21:57 faith Exp $
 
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -41,7 +41,7 @@
  The following BIOS versions are supported: 2.0, 3.0, 3.2, 3.4, and 3.5.
  The following chips are supported: TMC-1800, TMC-18C50, TMC-18C30.
  Reports suggest that the driver will also work with the 36C70 chip and
- with the Quantum ISA-200S SCSI adapter.
+ with the Quantum ISA-200S and ISA-250MG SCSI adapters.
 
  Please note that the drive ordering that Future Domain implemented in BIOS
  versions 3.4 and 3.5 is the opposite of the order (currently) used by the
  and to Martin Andrews (andrewm@ccfadm.eeg.ccf.org) for the signature to
  some random TMC-1680 repackaged by IBM.
 
+ Thanks for Mark Singer (elf@netcom.com) and Richard Simpson
+ (rsimpson@ewrcsdra.demon.co.uk) for more Quantum signatures and detective
+ work on the Quantum RAM layout.
+
  All of the alpha testers deserve much thanks.
 
 
 #include <linux/string.h>
 #include <linux/ioport.h>
 
-#define VERSION          "$Revision: 5.26 $"
+#define VERSION          "$Revision: 5.28 $"
 
 /* START OF USER DEFINABLE OPTIONS */
 
@@ -281,7 +285,7 @@ static void              *bios_base        = NULL;
 static int               bios_major        = 0;
 static int               bios_minor        = 0;
 static int               PCI_bus           = 0;
-static int               ISA_200S          = 0;        /* Quantum ISA-200S */
+static int               Quantum           = 0;        /* Quantum board variant */
 static int               interrupt_level   = 0;
 static volatile int      in_command        = 0;
 static Scsi_Cmnd         *current_SC       = NULL;
@@ -357,18 +361,22 @@ struct signature {
    int  sig_length;
    int  major_bios_version;
    int  minor_bios_version;
-   int  flag;                  /* 1 == PCI_bus, 2 == ISA_200S */
+   int  flag; /* 1 == PCI_bus, 2 == ISA_200S, 3 == ISA_250MG, 4 == ISA_200S */
 } signatures[] = {
    /*          1         2         3         4         5         6 */
    /* 123456789012345678901234567890123456789012345678901234567890 */
    { "FUTURE DOMAIN CORP. (C) 1986-1990 1800-V2.07/28/89",  5, 50,  2,  0, 0 },
    { "FUTURE DOMAIN CORP. (C) 1986-1990 1800-V1.07/28/89",  5, 50,  2,  0, 0 },
    { "FUTURE DOMAIN CORP. (C) 1986-1990 1800-V2.07/28/89", 72, 50,  2,  0, 2 },
+   { "FUTURE DOMAIN CORP. (C) 1986-1990 1800-V2.0",        73, 43,  2,  0, 3 },
+   { "FUTURE DOMAIN CORP. (C) 1991 1800-V2.0.",            72, 39,  2,  0, 4 },
    { "FUTURE DOMAIN CORP. (C) 1992 V3.00.004/02/92",        5, 44,  3,  0, 0 },
    { "FUTURE DOMAIN TMC-18XX (C) 1993 V3.203/12/93",        5, 44,  3,  2, 0 },
    { "IBM F1 P2 BIOS v1.0104/29/93",                        5, 28,  3, -1, 0 },
    { "Future Domain Corp. V1.0008/18/93",                   5, 33,  3,  4, 0 },
    { "Future Domain Corp. V1.0008/18/93",                  26, 33,  3,  4, 1 },
+                               /* This next signature may not be a 3.5 bios */
+   { "Future Domain Corp. V2.0108/18/93",                   5, 33,  3,  5, 0 },
    { "FUTURE DOMAIN CORP.  V3.5008/18/93",                  5, 34,  3,  5, 0 },
    { "FUTURE DOMAIN 18c30/18c50/1800 (C) 1994 V3.5",        5, 44,  3,  5, 0 },
    { "FUTURE DOMAIN TMC-18XX",                              5, 22, -1, -1, 0 },
@@ -558,7 +566,7 @@ int fdomain_16x0_detect( Scsi_Host_Template *tpnt )
            bios_major = signatures[j].major_bios_version;
            bios_minor = signatures[j].minor_bios_version;
            PCI_bus    = (signatures[j].flag == 1);
-           ISA_200S   = (signatures[j].flag == 2);
+           Quantum    = (signatures[j].flag > 1) ? signatures[j].flag : 0;
            bios_base  = addresses[i];
         }
       }
@@ -580,12 +588,20 @@ int fdomain_16x0_detect( Scsi_Host_Template *tpnt )
         DOS (this geometry has nothing to do with physical geometry).
        */
 
-      if (ISA_200S) {          /* The Quantum board is slightly different. */
+      switch (Quantum) {
+      case 2:                  /* ISA_200S */
+      case 3:                  /* ISA_250MG */
         port_base = *((char *)bios_base + 0x1fa2)
               + (*((char *)bios_base + 0x1fa3) << 8);
-      } else {
+        break;
+      case 4:                  /* ISA_200S (another one) */
+        port_base = *((char *)bios_base + 0x1fa3)
+              + (*((char *)bios_base + 0x1fa4) << 8);
+        break;
+      default:
         port_base = *((char *)bios_base + 0x1fcc)
               + (*((char *)bios_base + 0x1fcd) << 8);
+        break;
       }
    
 #if DEBUG_DETECT
@@ -648,7 +664,7 @@ int fdomain_16x0_detect( Scsi_Host_Template *tpnt )
            scan more addresses.  If you have to modify this section for
            your installation, please send mail to faith@cs.unc.edu. */
 
-        for (i = 0xff00; !flag && i > 0xf000; i -= 8) {
+        for (i = 0xfff8; !flag && i > 0xe000; i -= 8) {
            port_base = i;
            if (check_region( port_base, 0x10 )) {
 #if DEBUG_DETECT
@@ -1603,10 +1619,21 @@ int fdomain_16x0_biosparam( Scsi_Disk *disk, int dev, int *info_array )
    drive = MINOR(dev) / 16;
 
    if (bios_major == 2) {
-      if (ISA_200S) {
+      switch (Quantum) {
+      case 2:                  /* ISA_200S */
+                               /* The value of 25 has never been verified.
+                                  It should probably be 15. */
         i = (struct drive_info *)( (char *)bios_base + 0x1f33 + drive * 25 );
-      } else {
+        break;
+      case 3:                  /* ISA_250MG */
+        i = (struct drive_info *)( (char *)bios_base + 0x1f36 + drive * 15 );
+        break;
+      case 4:                  /* ISA_200S (another one) */
+        i = (struct drive_info *)( (char *)bios_base + 0x1f34 + drive * 15 );
+        break;
+      default:
         i = (struct drive_info *)( (char *)bios_base + 0x1f31 + drive * 25 );
+        break;
       }
       info_array[0] = i->heads;
       info_array[1] = i->sectors;
index 0112d5d7132b7a50dcc3033960d78b22c67ca503..384fb64625459b990d67e4ec72213df975732f12 100644 (file)
@@ -119,8 +119,8 @@ st_chk_result(Scsi_Cmnd * SCpnt)
 #ifdef DEBUG
   if (debugging) {
     printk("st%d: Error: %x, cmd: %x %x %x %x %x %x Len: %d\n", dev, result,
-          SCpnt->cmnd[0], SCpnt->cmnd[1], SCpnt->cmnd[2],
-          SCpnt->cmnd[3], SCpnt->cmnd[4], SCpnt->cmnd[5],
+          SCpnt->data_cmnd[0], SCpnt->data_cmnd[1], SCpnt->data_cmnd[2],
+          SCpnt->data_cmnd[3], SCpnt->data_cmnd[4], SCpnt->data_cmnd[5],
           SCpnt->request_bufflen);
     if (driver_byte(result) & DRIVER_SENSE)
       print_sense("st", SCpnt);
@@ -144,15 +144,15 @@ st_chk_result(Scsi_Cmnd * SCpnt)
   if ((sense[0] & 0x70) == 0x70 &&
       scode == RECOVERED_ERROR
 #ifdef ST_RECOVERED_WRITE_FATAL
-      && SCpnt->cmnd[0] != WRITE_6
-      && SCpnt->cmnd[0] != WRITE_FILEMARKS
+      && SCpnt->data_cmnd[0] != WRITE_6
+      && SCpnt->data_cmnd[0] != WRITE_FILEMARKS
 #endif
       ) {
     scsi_tapes[dev].recover_count++;
     scsi_tapes[dev].mt_status->mt_erreg += (1 << MT_ST_SOFTERR_SHIFT);
-    if (SCpnt->cmnd[0] == READ_6)
+    if (SCpnt->data_cmnd[0] == READ_6)
       stp = "read";
-    else if (SCpnt->cmnd[0] == WRITE_6)
+    else if (SCpnt->data_cmnd[0] == WRITE_6)
       stp = "write";
     else
       stp = "ioctl";
@@ -640,6 +640,12 @@ scsi_tape_open(struct inode * inode, struct file * filp)
       if (debugging)
        printk( "st%d: Write protected\n", dev);
 #endif
+      if ((flags & O_ACCMODE) == O_WRONLY || (flags & O_ACCMODE) == O_RDWR) {
+       (STp->buffer)->in_use = 0;
+       STp->buffer = 0;
+       STp->in_use = 0;
+       return (-EROFS);
+      }
     }
 
     if (scsi_tapes[dev].device->host->hostt->usage_count)
index 3cc827f666e0bdeb78b807750ebfb0cf49a87349..ecdffb85a48c2a7a814003fe7eed5031d30d33d3 100644 (file)
@@ -208,10 +208,13 @@ static unsigned int load_elf_interp(struct elfhdr * interp_elf_ex,
        eppnt = elf_phdata;
        for(i=0; i<interp_elf_ex->e_phnum; i++, eppnt++)
          if(eppnt->p_type == PT_LOAD) {
+           int elf_prot = (eppnt->p_flags & PF_R) ? PROT_READ : 0;
+           if (eppnt->p_flags & PF_W) elf_prot |= PROT_WRITE;
+           if (eppnt->p_flags & PF_X) elf_prot |= PROT_EXEC;
            error = do_mmap(file, 
                            eppnt->p_vaddr & 0xfffff000,
                            eppnt->p_filesz + (eppnt->p_vaddr & 0xfff),
-                           PROT_READ | PROT_WRITE | PROT_EXEC,
+                           elf_prot,
                            MAP_PRIVATE | MAP_DENYWRITE | (interp_elf_ex->e_type == ET_EXEC ? MAP_FIXED : 0),
                            eppnt->p_offset & 0xfffff000);
            
@@ -530,10 +533,13 @@ load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
                
                
                if(elf_ppnt->p_type == PT_LOAD) {
+                       int elf_prot = (elf_ppnt->p_flags & PF_R) ? PROT_READ : 0;
+                       if (elf_ppnt->p_flags & PF_W) elf_prot |= PROT_WRITE;
+                       if (elf_ppnt->p_flags & PF_X) elf_prot |= PROT_EXEC;
                        error = do_mmap(file,
                                        elf_ppnt->p_vaddr & 0xfffff000,
                                        elf_ppnt->p_filesz + (elf_ppnt->p_vaddr & 0xfff),
-                                       PROT_READ | PROT_WRITE | PROT_EXEC,
+                                       elf_prot,
                                        MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE,
                                        elf_ppnt->p_offset & 0xfffff000);
                        
@@ -615,12 +621,15 @@ load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
        printk("(brk) %x\n" , current->mm->brk);
 #endif
 
-       /* Why this, you ask???  Well SVr4 maps page 0 as read-only,
-          and some applications "depend" upon this behavior.
-          Since we do not have the power to recompile these, we
-          emulate the SVr4 behavior.  Sigh.  */
-       error = do_mmap(NULL, 0, 4096, PROT_READ | PROT_EXEC,
-                       MAP_FIXED | MAP_PRIVATE, 0);
+       if( current->personality == PER_SVR4 )
+       {
+               /* Why this, you ask???  Well SVr4 maps page 0 as read-only,
+                  and some applications "depend" upon this behavior.
+                  Since we do not have the power to recompile these, we
+                  emulate the SVr4 behavior.  Sigh.  */
+               error = do_mmap(NULL, 0, 4096, PROT_READ | PROT_EXEC,
+                               MAP_FIXED | MAP_PRIVATE, 0);
+       }
 
        start_thread(regs, elf_entry, bprm->p);
        if (current->flags & PF_PTRACED)
index 4e40e910d7edd46a0ecb9a00da6cc90fa1ad6945..cf024730725bd77c03cfbde7759dd790c4b8e3bf 100644 (file)
@@ -148,6 +148,12 @@ typedef struct elfhdr{
   Elf32_Half   e_shstrndx;
 } Elf32_Ehdr;
 
+/* These constants define the permissions on sections in the program
+   header, p_flags. */
+#define PF_R           0x4
+#define PF_W           0x2
+#define PF_X           0x1
+
 typedef struct elf_phdr{
   Elf32_Word   p_type;
   Elf32_Off    p_offset;
@@ -235,6 +241,19 @@ typedef struct {
 #define EV_CURRENT     1
 #define EV_NUM         2
 
+/* Notes used in ET_CORE */
+#define NT_PRSTATUS    1
+#define NT_PRFPREG     2
+#define NT_PRPSINFO    3
+#define NT_TASKSTRUCT  4
+
+/* Note header in a PT_NOTE section */
+typedef struct elf_note {
+  Elf32_Word   n_namesz;       /* Name size */
+  Elf32_Word   n_descsz;       /* Content size */
+  Elf32_Word   n_type;         /* Content type */
+} Elf32_Nhdr;
+
 #define ELF_START_MMAP 0x80000000
 
 #endif /* _LINUX_ELF_H */
index 818648ce2ac6b63ed0ca5ccae8554ee1b269ad2c..ee7ec8d4c4c287f4b251b7182fa72758df2ec4a3 100644 (file)
 #if !(SBPCD_ISSUE-1)     /* first (or if you have only one) interface board: */
 #define CDROM_PORT 0x340 /* <-----------<< port address                      */
 #define SBPRO      0     /* <-----------<< interface type                    */
+#define MAX_DRIVES 4     /* set to 1 if the card does not use "drive select" */
 #define SOUND_BASE 0x220 /* <-----------<< sound address of this card or 0   */
 #endif
 #if !(SBPCD_ISSUE-2)     /* ==================== second interface board: === */
 #define CDROM_PORT 0x344 /* <-----------<< port address                      */
 #define SBPRO      0     /* <-----------<< interface type                    */
+#define MAX_DRIVES 4     /* set to 1 if the card does not use "drive select" */
 #define SOUND_BASE 0x000 /* <-----------<< sound address of this card or 0   */
 #endif
 #if !(SBPCD_ISSUE-3)     /* ===================== third interface board: === */
 #define CDROM_PORT 0x634 /* <-----------<< port address                      */
 #define SBPRO      1     /* <-----------<< interface type                    */
+#define MAX_DRIVES 4     /* set to 1 if the card does not use "drive select" */
 #define SOUND_BASE 0x240 /* <-----------<< sound address of this card or 0   */
 #endif
 #if !(SBPCD_ISSUE-4)     /* ==================== fourth interface board: === */
 #define CDROM_PORT 0x634 /* <-----------<< port address                      */
 #define SBPRO      0     /* <-----------<< interface type                    */
+#define MAX_DRIVES 4     /* set to 1 if the card does not use "drive select" */
 #define SOUND_BASE 0x000 /* <-----------<< sound address of this card or 0   */
 #endif
 
@@ -606,10 +610,11 @@ Read XA Parameter:
 #define CMD1_SUBCHANINF        0x11
 #define CMD2_SUBCHANINF        0x??
 
+#define CMD1_ABORT     0x08
+#define CMD2_ABORT     0x08
+#define CMDT_ABORT     0x08
+
 #define CMD2_x02       0x02
-#define CMD1_x08       0x08
-#define CMD2_x08       0x08
-#define CMDT_x08       0x08
 
 #define CMD2_SETSPEED  0xda
 
@@ -668,6 +673,7 @@ Read XA Parameter:
 #define CMDL_PLAY_MSF  0x???
 
 #define CMD0_PLAY_TI   0x0c
+#define CMD1_PLAY_TI   0x0f
 
 #define CMD0_STATUS    0x81
 #define CMD1_STATUS    0x05
index a7cfa23619bb9765dd11495d6c46f290be18664b..10a124c74a2e3e22cf61cd7a1833e4deb7ca10ce 100644 (file)
@@ -37,15 +37,15 @@ struct tcphdr {
                urg:1,
                res2:2;
 #elif defined(BIG_ENDIAN_BITFIELD)
-       __u16   res2:2,
+       __u16   doff:4,
+               res1:4,
+               res2:2,
                urg:1,
                ack:1,
                psh:1,
                rst:1,
                syn:1,
-               fin:1,
-               doff:4,
-               res1:4;
+               fin:1;
 #else
 #error "Adjust your <asm/byteorder.h> defines"
 #endif 
index 04bb8d08fcba13871ea2252d8164f752aec46beb..7f7dd9ec530249da996864bd1de90e740fb20d30 100644 (file)
@@ -941,9 +941,12 @@ static int inet_connect(struct socket *sock, struct sockaddr * uaddr,
 
        if (sock->state == SS_CONNECTING && sk->protocol == IPPROTO_TCP && (flags & O_NONBLOCK)) {
                if (sk->err != 0)
-                       return -sk->err;        /* Connection must have failed */
-               else
-                       return -EALREADY;       /* Connecting is currently in progress */
+               {
+                       err=sk->err;
+                       sk->err=0;
+                       return -err;
+               }
+               return -EALREADY;       /* Connecting is currently in progress */
        }
        
        if (sock->state != SS_CONNECTING) 
index 0572c8f168e862e0a286f0abb3164b80618d3841..96b6fced2b7d48cb3e5779ed27cb2985533e2791 100644 (file)
@@ -961,7 +961,7 @@ static int ip_chain_procinfo(int stage, char *buffer, char **start,
                        ntohl(i->fw_src.s_addr),ntohl(i->fw_smsk.s_addr),
                        ntohl(i->fw_dst.s_addr),ntohl(i->fw_dmsk.s_addr),
                        ntohl(i->fw_via.s_addr),i->fw_flg);
-               len+=sprintf(buffer+len,"%u %u %lu %lu",
+               len+=sprintf(buffer+len,"%u %u %10lu %10lu",
                        i->fw_nsp,i->fw_ndp, i->fw_pcnt,i->fw_bcnt);
                for (p = 0; p < IP_FW_MAX_PORTS; p++)
                        len+=sprintf(buffer+len, " %u", i->fw_pts[p]);