]> git.neil.brown.name Git - history.git/commitdiff
Import 2.0.36pre10 2.0.36pre10
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:11:59 +0000 (15:11 -0500)
committerAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:11:59 +0000 (15:11 -0500)
16 files changed:
arch/i386/math-emu/reg_u_sub.S
drivers/char/isicom.c
drivers/char/isicom.h [deleted file]
drivers/char/random.c
drivers/net/de4x5.c
drivers/scsi/sd.c
drivers/scsi/seagate.c
drivers/sound/Readme
drivers/sound/ad1848_mixer.h
fs/fat/misc.c
include/linux/interrupt.h
include/linux/isicom.h [new file with mode: 0644]
include/linux/types.h
init/main.c
mm/swapfile.c
net/socket.c

index 89167026002be7a8cf95a5bf59f75d4a84c05939..03c961cc41e6d319dddb01e6f697a7a3dbb7f155 100644 (file)
@@ -66,7 +66,7 @@ xOp2_not_denorm:
        /* source 2 is always smaller than source 1 */
        js      L_bugged_1
 
-       testl   $0x80000000,SIGH(%edi)  /* The args are assumed to be be normalized */
+       testl   $0x80000000,SIGH(%edi)  /* The args are assumed to be normalized */
        je      L_bugged_2
 
        testl   $0x80000000,SIGH(%esi)
index de2383c99b9ad8469ea0624c8a7b50e0ede58c18..fbbf48bfc1b4ff8c7213d81b86ed0e8c859d1fc1 100644 (file)
  *                                     Printk clean up
  */
 
+/*
+ *             Currently ISICOM_BH is hard coded to 16 in isicom.h, cannot
+ *             ask the kernel for a free slot as of 2.0.x - sameer
+ */
+
+
 #include <linux/config.h> 
 #include <linux/module.h>
 #include <linux/version.h>
@@ -31,7 +37,7 @@
 #include <asm/segment.h>
 #include <asm/system.h>
 #include <asm/io.h>
-#include "isicom.h"
+#include <linux/isicom.h>
 
 static int isicom_refcount = 0;
 static int prev_card = 3;      /*      start servicing isi_card[0]     */
@@ -108,7 +114,7 @@ extern inline int WaitTillCardIsFree(unsigned short base)
 static int ISILoad_open(struct inode *inode, struct file *filp)
 {
 #ifdef ISICOM_DEBUG    
-       printk(KERN_DEBUG "ISILoad:Card%d Opened!!!\n",MINOR(inode->i_rdev)+1);
+       printk(KERN_DEBUG "ISILoad:Firmware loader Opened!!!\n");
 #endif 
        return 0;
 }
@@ -116,7 +122,7 @@ static int ISILoad_open(struct inode *inode, struct file *filp)
 static void ISILoad_release(struct inode *inode, struct file *filp)
 {
 #ifdef ISICOM_DEBUG
-       printk(KERN_DEBUG "ISILoad:Card%d Close(Release)d\n",MINOR(inode->i_rdev)+1);
+       printk(KERN_DEBUG "ISILoad:Firmware loader Close(Release)d\n",);
 #endif 
 }
 
@@ -128,15 +134,20 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp,
        bin_frame frame;
        /* exec_record exec_rec; */
        
-       i=get_user((int *)arg);
-       if(i<0 || i >= BOARD_COUNT)
+       /*      Added this check to avoid oopses on an ioctl with no
+        *      args - sameer
+        */ 
+       error=verify_area(VERIFY_READ, (void *) arg, sizeof(int));
+       if (error)
+               return error;
+       card=get_user((int *)arg);
+       if(card < 0 || card >= BOARD_COUNT)
                return -ENXIO;
                
-       card=i;
        base=isi_card[card].base;
        
        if(base==0)
-               return -ENXIO;
+               return -ENXIO;  /* disabled or not used */
        
        switch(cmd) {
                case MIOCTL_RESET_CARD:
@@ -347,7 +358,7 @@ extern inline void schedule_bh(struct isi_port * port)
 static void isicom_tx(unsigned long _data)
 {
        short count = (BOARD_COUNT-1), card, base;
-       short txcount, wait, wrd;
+       short txcount, wait, wrd, residue, word_count, cnt;
        struct isi_port * port;
        struct tty_struct * tty;
        unsigned long flags;
@@ -357,11 +368,11 @@ static void isicom_tx(unsigned long _data)
 #endif 
        
        /*      find next active board  */
-       card = (prev_card + 1) % 4;
+       card = (prev_card + 1) & 0x0003;
        while(count-- > 0) {
                if (isi_card[card].status & BOARD_ACTIVE) 
                        break;
-               card = (card + 1) % 4;  
+               card = (card + 1) & 0x0003;     
        }
        if (!(isi_card[card].status & BOARD_ACTIVE))
                goto sched_again;
@@ -383,7 +394,7 @@ static void isicom_tx(unsigned long _data)
                        restore_flags(flags);
                        continue;
                }
-               wait = 300;     
+               wait = 200;     
                while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
                if (wait <= 0) {
                        restore_flags(flags);
@@ -407,6 +418,45 @@ static void isicom_tx(unsigned long _data)
 #endif 
                outw((port->channel << isi_card[card].shift_count) | txcount
                                        , base);
+               residue = NO;
+               wrd = 0;                        
+               while (1) {
+                       cnt = MIN(txcount, (SERIAL_XMIT_SIZE - port->xmit_tail));
+                       if (residue == YES) {
+                               residue = NO;
+                               if (cnt > 0) {
+                                       wrd |= (port->xmit_buf[port->xmit_tail] << 8);
+                                       port->xmit_tail = (port->xmit_tail + 1) & (SERIAL_XMIT_SIZE - 1);
+                                       port->xmit_cnt--;
+                                       txcount--;
+                                       cnt--;
+                                       outw(wrd, base);                        
+                               }
+                               else {
+                                       outw(wrd, base);
+                                       break;
+                               }
+                       }               
+                       if (cnt <= 0) break;
+                       word_count = cnt >> 1;
+                       outsw(base, port->xmit_buf+port->xmit_tail, word_count);
+                       port->xmit_tail = (port->xmit_tail + (word_count << 1)) &
+                                               (SERIAL_XMIT_SIZE - 1);
+                       txcount -= (word_count << 1);
+                       port->xmit_cnt -= (word_count << 1);
+                       if (cnt & 0x0001) {
+                               residue = YES;
+                               wrd = port->xmit_buf[port->xmit_tail];
+                               port->xmit_tail = (port->xmit_tail + 1) & (SERIAL_XMIT_SIZE - 1);
+                               port->xmit_cnt--;
+                               txcount--;
+                       }
+               }
+/*
+ *     Replaced the code below with hopefully a faster loop - sameer
+ */
+
+/*                                     
                while (1) {
                        wrd = port->xmit_buf[port->xmit_tail++];
                        port->xmit_tail = port->xmit_tail & (SERIAL_XMIT_SIZE - 1);
@@ -423,6 +473,7 @@ static void isicom_tx(unsigned long _data)
                                break;
                        }
                }
+*/
                InterruptTheCard(base);
                if (port->xmit_cnt <= 0)
                        port->status &= ~ISI_TXOK;
@@ -436,7 +487,7 @@ sched_again:
        if (!re_schedule)       
                return;
        init_timer(&tx);
-       tx.expires = jiffies + 1;
+       tx.expires = jiffies + HZ/100;
        tx.data = 0;
        tx.function = isicom_tx;
        add_timer(&tx);
@@ -608,7 +659,7 @@ static void isicom_interrupt(int irq, void * dev_id, struct pt_regs * regs)
                insw(base, tty->flip.char_buf_ptr, word_count);
                tty->flip.char_buf_ptr += (word_count << 1);            
                byte_count -= (word_count << 1);
-               if (count % 2) {
+               if (count & 0x0001) {
                        *tty->flip.char_buf_ptr++ = (char)(inw(base) & 0xff);
                        byte_count -= 2;
                }       
@@ -616,12 +667,13 @@ static void isicom_interrupt(int irq, void * dev_id, struct pt_regs * regs)
                tty->flip.flag_buf_ptr += count;
                tty->flip.count += count;
                
-               if (byte_count > 0)
+               if (byte_count > 0) {
                        printk(KERN_DEBUG "ISICOM: Intr(0x%x:%d): Flip buffer overflow! dropping bytes...\n",
                                        base, channel+1);
-               while(byte_count > 0) { /* drain out unread xtra data */
-                       inw(base);
-                       byte_count -= 2;
+                       while(byte_count > 0) { /* drain out unread xtra data */
+                               inw(base);
+                               byte_count -= 2;
+                       }
                }
                queue_task_irq_off(&tty->flip.tqueue, &tq_timer);
        }
@@ -1305,7 +1357,8 @@ static int isicom_get_modem_info(struct isi_port * port, unsigned int * value)
                ((status & ISI_DTR) ? TIOCM_DTR : 0) |
                ((status & ISI_DCD) ? TIOCM_CAR : 0) |
                ((status & ISI_DSR) ? TIOCM_DSR : 0) |
-               ((status & ISI_CTS) ? TIOCM_CTS : 0);
+               ((status & ISI_CTS) ? TIOCM_CTS : 0) |
+               ((status & ISI_RI ) ? TIOCM_RI  : 0);
        put_user(info, (unsigned long *) value);
        return 0;       
 }
diff --git a/drivers/char/isicom.h b/drivers/char/isicom.h
deleted file mode 100644 (file)
index 040d2f0..0000000
+++ /dev/null
@@ -1,300 +0,0 @@
-#ifndef ISICOM_H
-#define ISICOM_H
-
-/*#define              ISICOM_DEBUG*/
-/*#define              ISICOM_DEBUG_DTR_RTS*/
-
-
-
-/*
- *     Firmware Loader definitions ...
- */
-
-#define                ISILOAD_MISC_MINOR      155     /* /dev/isctl */
-#define                ISILOAD_NAME            "ISILoad"
-#define                MultiTech               ('M'<<8)
-#define                MIOCTL_LOAD_FIRMWARE    (MultiTech | 0x01)
-#define         MIOCTL_READ_FIRMWARE    (MultiTech | 0x02)
-#define         MIOCTL_XFER_CTRL       (MultiTech | 0x03)
-#define         MIOCTL_RESET_CARD      (MultiTech | 0x04)
-
-#define                DATA_SIZE       16
-
-typedef        struct  {
-               unsigned short  exec_segment;
-               unsigned short  exec_addr;
-}      exec_record;
-
-typedef        struct  {
-               int             board;          /* Board to load */
-               unsigned short  addr;
-               unsigned short  count;
-}      bin_header;
-
-typedef        struct  {
-               int             board;          /* Board to load */
-               unsigned short  addr;
-               unsigned short  count;
-               unsigned short  segment;
-               unsigned char   bin_data[DATA_SIZE];
-}      bin_frame;
-
-#ifdef __KERNEL__
-
-/*     
- *  ISICOM Driver definitions ...
- *
- */
-
-#define                ISICOM_NAME     "ISICom"
-
-/*
- *     These are now officially allocated numbers
- */
-
-#define                ISICOM_NMAJOR   112     /* normal  */
-#define                ISICOM_CMAJOR   113     /* callout */
-#define                ISICOM_MAGIC    (('M' << 8) | 'T')
-
-#define                ISICOM_BH       16      /* bottom half entry # */ 
-#define                WAKEUP_CHARS    256     /* hard coded for now   */ 
-#define                TX_SIZE         254 
-#define                BOARD_COUNT     4
-#define                PORT_COUNT      (BOARD_COUNT*16)
-
-#define                SERIAL_TYPE_NORMAL      1
-#define                SERIAL_TYPE_CALLOUT     2
-
-/*   character sizes  */
-
-#define                ISICOM_CS5              0x0000
-#define                ISICOM_CS6              0x0001
-#define                ISICOM_CS7              0x0002
-#define                ISICOM_CS8              0x0003
-
-/* stop bits */
-
-#define                ISICOM_1SB              0x0000
-#define                ISICOM_2SB              0x0004
-
-/* parity */
-
-#define                ISICOM_NOPAR            0x0000
-#define                ISICOM_ODPAR            0x0008
-#define                ISICOM_EVPAR            0x0018
-
-/* flow control */
-
-#define                ISICOM_CTSRTS           0x03
-#define                ISICOM_INITIATE_XONXOFF 0x04
-#define                ISICOM_RESPOND_XONXOFF  0x08
-
-#define InterruptTheCard(base) (outw(0,(base)+0xc)) 
-#define ClearInterrupt(base) (inw((base)+0x0a))        
-
-#define        BOARD(line)  (((line) >> 4) & 0x3)
-#define MIN(a, b) ( (a) < (b) ? (a) : (b) )
-
-       /*      isi kill queue bitmap   */
-       
-#define                ISICOM_KILLTX           0x01
-#define                ISICOM_KILLRX           0x02
-
-       /* isi_board status bitmap */
-       
-#define                FIRMWARE_LOADED         0x0001
-#define                BOARD_ACTIVE            0x0002
-
-       /* isi_port status bitmap  */
-
-#define                ISI_CTS                 0x1000
-#define                ISI_DSR                 0x2000
-#define                ISI_RI                  0x4000
-#define                ISI_DCD                 0x8000
-#define                ISI_DTR                 0x0100
-#define                ISI_RTS                 0x0200
-
-
-#define                ISI_TXOK                0x0001 
-struct isi_board {
-       unsigned short          base;
-       unsigned char           irq;
-       unsigned char           port_count;
-       unsigned short          status;
-       unsigned short          port_status; /* each bit represents a single port */
-       unsigned short          shift_count;
-       struct isi_port         * ports;
-       signed char             count;
-};
-
-struct isi_port {
-       unsigned short          magic;
-       unsigned int            flags;
-       int                     count;
-       int                     blocked_open;
-       int                     close_delay;
-       unsigned short          channel;
-       unsigned short          status;
-       unsigned short          closing_wait;
-       long                    session;
-       long                    pgrp;
-       struct isi_board        * card;
-       struct tty_struct       * tty;
-       struct wait_queue       * close_wait;
-       struct wait_queue       * open_wait;
-       struct tq_struct        hangup_tq;
-       struct tq_struct        bh_tqueue;
-       unsigned char           * xmit_buf;
-       int                     xmit_head;
-       int                     xmit_tail;
-       int                     xmit_cnt;
-       struct termios          normal_termios;
-       struct termios          callout_termios;
-};
-
-
-/*
- *  ISI Card specific ops ...
- */
-extern inline void raise_dtr(struct isi_port * port)
-{
-       struct isi_board * card = port->card;
-       unsigned short base = card->base;
-       unsigned char channel = port->channel;
-       short wait=300;
-       while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
-       if (wait <= 0) {
-               printk(KERN_WARNING "ISICOM: Card found busy in raise_dtr.\n");
-               return;
-       }
-#ifdef ISICOM_DEBUG_DTR_RTS    
-       printk(KERN_DEBUG "ISICOM: raise_dtr.\n");
-#endif 
-       outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
-       outw(0x0504, base);
-       InterruptTheCard(base);
-       port->status |= ISI_DTR;
-}
-extern inline void drop_dtr(struct isi_port * port)
-{      
-       struct isi_board * card = port->card;
-       unsigned short base = card->base;
-       unsigned char channel = port->channel;
-       short wait=300;
-       while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
-       if (wait <= 0) {
-               printk(KERN_WARNING "ISICOM: Card found busy in drop_dtr.\n");
-               return;
-       }
-#ifdef ISICOM_DEBUG_DTR_RTS    
-       printk(KERN_DEBUG "ISICOM: drop_dtr.\n");
-#endif 
-       outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
-       outw(0x0404, base);
-       InterruptTheCard(base); 
-       port->status &= ~ISI_DTR;
-}
-extern inline void raise_rts(struct isi_port * port)
-{
-       struct isi_board * card = port->card;
-       unsigned short base = card->base;
-       unsigned char channel = port->channel;
-       short wait=300;
-       while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
-       if (wait <= 0) {
-               printk(KERN_WARNING "ISICOM: Card found busy in raise_rts.\n");
-               return;
-       }
-#ifdef ISICOM_DEBUG_DTR_RTS    
-       printk(KERN_DEBUG "ISICOM: raise_rts.\n");
-#endif 
-       outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
-       outw(0x0a04, base);
-       InterruptTheCard(base); 
-       port->status |= ISI_RTS;
-}
-extern inline void drop_rts(struct isi_port * port)
-{
-       struct isi_board * card = port->card;
-       unsigned short base = card->base;
-       unsigned char channel = port->channel;
-       short wait=300;
-       while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
-       if (wait <= 0) {
-               printk(KERN_WARNING "ISICOM: Card found busy in drop_rts.\n");
-               return;
-       }
-#ifdef ISICOM_DEBUG_DTR_RTS    
-       printk(KERN_DEBUG "ISICOM: drop_rts.\n");
-#endif 
-       outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
-       outw(0x0804, base);
-       InterruptTheCard(base); 
-       port->status &= ~ISI_RTS;
-}
-extern inline void raise_dtr_rts(struct isi_port * port)
-{
-       struct isi_board * card = port->card;
-       unsigned short base = card->base;
-       unsigned char channel = port->channel;
-       short wait=300;
-       while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
-       if (wait <= 0) {
-               printk(KERN_WARNING "ISICOM: Card found busy in raise_dtr_rts.\n");
-               return;
-       }
-#ifdef ISICOM_DEBUG_DTR_RTS    
-       printk(KERN_DEBUG "ISICOM: raise_dtr_rts.\n");
-#endif 
-       outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
-       outw(0x0f04, base);
-       InterruptTheCard(base);
-       port->status |= (ISI_DTR | ISI_RTS);
-}
-extern inline void drop_dtr_rts(struct isi_port * port)
-{
-       struct isi_board * card = port->card;
-       unsigned short base = card->base;
-       unsigned char channel = port->channel;
-       short wait=300;
-       while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
-       if (wait <= 0) {
-               printk(KERN_WARNING "ISICOM: Card found busy in drop_dtr_rts.\n");
-               return;
-       }
-#ifdef ISICOM_DEBUG_DTR_RTS    
-       printk(KERN_DEBUG "ISICOM: drop_dtr_rts.\n");
-#endif 
-       outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
-       outw(0x0c04, base);
-       InterruptTheCard(base); 
-       port->status &= ~(ISI_RTS | ISI_DTR);
-}
-
-extern inline void kill_queue(struct isi_port * port, short queue)
-{
-       struct isi_board * card = port->card;
-       unsigned short base = card->base;
-       unsigned char channel = port->channel;
-       short wait=300;
-       while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
-       if (wait <= 0) {
-               printk(KERN_WARNING "ISICOM: Card found busy in kill_queue.\n");
-               return;
-       }
-#ifdef ISICOM_DEBUG    
-       printk(KERN_DEBUG "ISICOM: kill_queue 0x%x.\n", queue);
-#endif 
-       outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
-       outw((queue << 8) | 0x06, base);
-       InterruptTheCard(base); 
-}
-
-#endif /*      __KERNEL__      */
-
-#endif /*      ISICOM_H        */
\ No newline at end of file
index ab0ed7f2fe0b30f505c8446f089c120534661c09..3e8d21d55036427e25b15e7d311052e7766addd5 100644 (file)
@@ -1500,7 +1500,7 @@ static inline unsigned long long get_clock_cnt(void)
 {
        unsigned long low, high;
        __asm__(".byte 0x0f,0x31" :"=a" (low), "=d" (high));
-       return (((unsigned long long) high << 31) | low); 
+       return (((unsigned long long) high << 32) | low); 
 }
 
 static void initialize_benchmark(struct random_benchmark *bench,
index 21b3497240d6a6242af02b02baa9165831254358..1b641b1e11dfac499effff9f21e8e1768f9afb7b 100644 (file)
@@ -1563,7 +1563,7 @@ de4x5_interrupt(int irq, void *dev_id, struct pt_regs *regs)
     lp = (struct de4x5_private *)dev->priv;
     iobase = dev->base_addr;
        
-    if (dev->interrupt)
+    if (test_and_set_bit(0, (void*) &dev->interrupt))
       printk("%s: Re-entering the interrupt handler.\n", dev->name);
        
     DISABLE_IRQs;                        /* Ensure non re-entrancy */
index 8e0da4b81670973e17056d5fb9e08ed318325924..c647ab44e5cd2c7494e30e5cd2d8ab90cb3204c2 100644 (file)
@@ -424,8 +424,8 @@ static void rw_intr (Scsi_Cmnd *SCpnt)
        /* If we had an ILLEGAL REQUEST returned, then we may have
         * performed an unsupported command.  The only thing this should be 
         * would be a ten byte read where only a six byte read was supported.
-        * Also, on a system where READ CAPACITY failed, we have have read 
-        * past the end of the disk. 
+        * Also, on a system where READ CAPACITY failed, we have read past
+        * the end of the disk. 
         */
 
        if (SCpnt->sense_buffer[2] == ILLEGAL_REQUEST) {
index c23fdb97ec7f9bc86c487d43b5dd4d940922551d..9e94274644e14278b79d8cbe3b5d4bac1ef33e78 100644 (file)
@@ -689,7 +689,7 @@ static int internal_command(unsigned char target, unsigned char lun, const void
                return DID_BAD_TARGET;
 
 /*
- *     We work it differently depending on if this is is "the first time,"
+ *     We work it differently depending on if this is "the first time,"
  *     or a reconnect.  If this is a reselect phase, then SEL will 
  *     be asserted, and we must skip selection / arbitration phases.
  */
index faf1b40517ca02ef75221761cb6b8460f72237c9..14154f3bcfde82699ad35d2ec51ac1e21c87117c 100644 (file)
@@ -157,7 +157,7 @@ The following errors are likely with /dev/dsp and /dev/audio.
        with impossible parameters. Check that the application is
        for sound driver version 2.X or later.
 
-In general the printout of of /dev/sndstat should tell what is the problem.
+In general the printout of /dev/sndstat should tell what is the problem.
 It's possible that there are bugs in the sound driver but 99% of the problems
 reported to me are caused by somehow incorrect setup during "make config".
 
index 073c14d95bbce1c3b48c11e88b1740435b82e257..46123483f4de410f757620edd481b65d67605e6a 100644 (file)
@@ -17,7 +17,7 @@
  * The AD1848 codec has generic input lines called Line, Aux1 and Aux2.
  * Soundcard manufacturers have connected actual inputs (CD, synth, line,
  * etc) to these inputs in different order. Therefore it's difficult
- * to assign mixer channels to to these inputs correctly. The following
+ * to assign mixer channels to these inputs correctly. The following
  * contains two alternative mappings. The first one is for GUS MAX and
  * the second is just a generic one (line1, line2 and line3).
  * (Actually this is not a mapping but rather some kind of interleaving
index 64790c59296a003c8dd5323e8f44bc6d3b9b4cf0..f710b7ffc033f0e2a98a80c3bb31f735fe887cc0 100644 (file)
@@ -515,7 +515,7 @@ static int raw_scan_nonroot(struct super_block *sb,int start,const char *name,
 /*
  * raw_scan performs raw_scan_sector on any sector.
  *
- * NOTE: raw_scan must not be used on a directory that is is the process of
+ * NOTE: raw_scan must not be used on a directory that is the process of
  *       being created.
  */
 
index ebcfa55dad30bd945e4e580c85ed65316b3c801b..8654a4f2ac8e12d39aa6e67e7b53e1a02e8bb4e7 100644 (file)
@@ -39,7 +39,8 @@ enum {
        IMMEDIATE_BH,
        KEYBOARD_BH,
        CYCLADES_BH,
-       CM206_BH
+       CM206_BH,
+       ISICOM_BH
 };
 
 extern inline void init_bh(int nr, void (*routine)(void))
diff --git a/include/linux/isicom.h b/include/linux/isicom.h
new file mode 100644 (file)
index 0000000..cea7d6f
--- /dev/null
@@ -0,0 +1,300 @@
+#ifndef _LINUX_ISICOM_H
+#define _LINUX_ISICOM_H
+
+/*#define              ISICOM_DEBUG*/
+/*#define              ISICOM_DEBUG_DTR_RTS*/
+
+
+/*
+ *     Firmware Loader definitions ...
+ */
+#define                __MultiTech             ('M'<<8)
+#define                MIOCTL_LOAD_FIRMWARE    (__MultiTech | 0x01)
+#define         MIOCTL_READ_FIRMWARE    (__MultiTech | 0x02)
+#define         MIOCTL_XFER_CTRL       (__MultiTech | 0x03)
+#define         MIOCTL_RESET_CARD      (__MultiTech | 0x04)
+
+#define                DATA_SIZE       16
+
+typedef        struct  {
+               unsigned short  exec_segment;
+               unsigned short  exec_addr;
+}      exec_record;
+
+typedef        struct  {
+               int             board;          /* Board to load */
+               unsigned short  addr;
+               unsigned short  count;
+}      bin_header;
+
+typedef        struct  {
+               int             board;          /* Board to load */
+               unsigned short  addr;
+               unsigned short  count;
+               unsigned short  segment;
+               unsigned char   bin_data[DATA_SIZE];
+}      bin_frame;
+
+#ifdef __KERNEL__
+
+#define                YES     1
+#define                NO      0
+
+#define                ISILOAD_MISC_MINOR      155     /* /dev/isctl */
+#define                ISILOAD_NAME            "ISILoad"
+
+/*     
+ *  ISICOM Driver definitions ...
+ *
+ */
+
+#define                ISICOM_NAME     "ISICom"
+
+/*
+ *     These are now officially allocated numbers
+ */
+
+#define                ISICOM_NMAJOR   112     /* normal  */
+#define                ISICOM_CMAJOR   113     /* callout */
+#define                ISICOM_MAGIC    (('M' << 8) | 'T')
+
+#define                WAKEUP_CHARS    256     /* hard coded for now   */ 
+#define                TX_SIZE         254 
+#define                BOARD_COUNT     4
+#define                PORT_COUNT      (BOARD_COUNT*16)
+
+#define                SERIAL_TYPE_NORMAL      1
+#define                SERIAL_TYPE_CALLOUT     2
+
+/*   character sizes  */
+
+#define                ISICOM_CS5              0x0000
+#define                ISICOM_CS6              0x0001
+#define                ISICOM_CS7              0x0002
+#define                ISICOM_CS8              0x0003
+
+/* stop bits */
+
+#define                ISICOM_1SB              0x0000
+#define                ISICOM_2SB              0x0004
+
+/* parity */
+
+#define                ISICOM_NOPAR            0x0000
+#define                ISICOM_ODPAR            0x0008
+#define                ISICOM_EVPAR            0x0018
+
+/* flow control */
+
+#define                ISICOM_CTSRTS           0x03
+#define                ISICOM_INITIATE_XONXOFF 0x04
+#define                ISICOM_RESPOND_XONXOFF  0x08
+
+#define InterruptTheCard(base) (outw(0,(base)+0xc)) 
+#define ClearInterrupt(base) (inw((base)+0x0a))        
+
+#define        BOARD(line)  (((line) >> 4) & 0x3)
+#define MIN(a, b) ( (a) < (b) ? (a) : (b) )
+
+       /*      isi kill queue bitmap   */
+       
+#define                ISICOM_KILLTX           0x01
+#define                ISICOM_KILLRX           0x02
+
+       /* isi_board status bitmap */
+       
+#define                FIRMWARE_LOADED         0x0001
+#define                BOARD_ACTIVE            0x0002
+
+       /* isi_port status bitmap  */
+
+#define                ISI_CTS                 0x1000
+#define                ISI_DSR                 0x2000
+#define                ISI_RI                  0x4000
+#define                ISI_DCD                 0x8000
+#define                ISI_DTR                 0x0100
+#define                ISI_RTS                 0x0200
+
+
+#define                ISI_TXOK                0x0001 
+struct isi_board {
+       unsigned short          base;
+       unsigned char           irq;
+       unsigned char           port_count;
+       unsigned short          status;
+       unsigned short          port_status; /* each bit represents a single port */
+       unsigned short          shift_count;
+       struct isi_port         * ports;
+       signed char             count;
+};
+
+struct isi_port {
+       unsigned short          magic;
+       unsigned int            flags;
+       int                     count;
+       int                     blocked_open;
+       int                     close_delay;
+       unsigned short          channel;
+       unsigned short          status;
+       unsigned short          closing_wait;
+       long                    session;
+       long                    pgrp;
+       struct isi_board        * card;
+       struct tty_struct       * tty;
+       struct wait_queue       * close_wait;
+       struct wait_queue       * open_wait;
+       struct tq_struct        hangup_tq;
+       struct tq_struct        bh_tqueue;
+       unsigned char           * xmit_buf;
+       int                     xmit_head;
+       int                     xmit_tail;
+       int                     xmit_cnt;
+       struct termios          normal_termios;
+       struct termios          callout_termios;
+};
+
+
+/*
+ *  ISI Card specific ops ...
+ */
+extern inline void raise_dtr(struct isi_port * port)
+{
+       struct isi_board * card = port->card;
+       unsigned short base = card->base;
+       unsigned char channel = port->channel;
+       short wait=300;
+       while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
+       if (wait <= 0) {
+               printk(KERN_WARNING "ISICOM: Card found busy in raise_dtr.\n");
+               return;
+       }
+#ifdef ISICOM_DEBUG_DTR_RTS    
+       printk(KERN_DEBUG "ISICOM: raise_dtr.\n");
+#endif 
+       outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
+       outw(0x0504, base);
+       InterruptTheCard(base);
+       port->status |= ISI_DTR;
+}
+extern inline void drop_dtr(struct isi_port * port)
+{      
+       struct isi_board * card = port->card;
+       unsigned short base = card->base;
+       unsigned char channel = port->channel;
+       short wait=300;
+       while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
+       if (wait <= 0) {
+               printk(KERN_WARNING "ISICOM: Card found busy in drop_dtr.\n");
+               return;
+       }
+#ifdef ISICOM_DEBUG_DTR_RTS    
+       printk(KERN_DEBUG "ISICOM: drop_dtr.\n");
+#endif 
+       outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
+       outw(0x0404, base);
+       InterruptTheCard(base); 
+       port->status &= ~ISI_DTR;
+}
+extern inline void raise_rts(struct isi_port * port)
+{
+       struct isi_board * card = port->card;
+       unsigned short base = card->base;
+       unsigned char channel = port->channel;
+       short wait=300;
+       while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
+       if (wait <= 0) {
+               printk(KERN_WARNING "ISICOM: Card found busy in raise_rts.\n");
+               return;
+       }
+#ifdef ISICOM_DEBUG_DTR_RTS    
+       printk(KERN_DEBUG "ISICOM: raise_rts.\n");
+#endif 
+       outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
+       outw(0x0a04, base);
+       InterruptTheCard(base); 
+       port->status |= ISI_RTS;
+}
+extern inline void drop_rts(struct isi_port * port)
+{
+       struct isi_board * card = port->card;
+       unsigned short base = card->base;
+       unsigned char channel = port->channel;
+       short wait=300;
+       while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
+       if (wait <= 0) {
+               printk(KERN_WARNING "ISICOM: Card found busy in drop_rts.\n");
+               return;
+       }
+#ifdef ISICOM_DEBUG_DTR_RTS    
+       printk(KERN_DEBUG "ISICOM: drop_rts.\n");
+#endif 
+       outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
+       outw(0x0804, base);
+       InterruptTheCard(base); 
+       port->status &= ~ISI_RTS;
+}
+extern inline void raise_dtr_rts(struct isi_port * port)
+{
+       struct isi_board * card = port->card;
+       unsigned short base = card->base;
+       unsigned char channel = port->channel;
+       short wait=300;
+       while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
+       if (wait <= 0) {
+               printk(KERN_WARNING "ISICOM: Card found busy in raise_dtr_rts.\n");
+               return;
+       }
+#ifdef ISICOM_DEBUG_DTR_RTS    
+       printk(KERN_DEBUG "ISICOM: raise_dtr_rts.\n");
+#endif 
+       outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
+       outw(0x0f04, base);
+       InterruptTheCard(base);
+       port->status |= (ISI_DTR | ISI_RTS);
+}
+extern inline void drop_dtr_rts(struct isi_port * port)
+{
+       struct isi_board * card = port->card;
+       unsigned short base = card->base;
+       unsigned char channel = port->channel;
+       short wait=300;
+       while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
+       if (wait <= 0) {
+               printk(KERN_WARNING "ISICOM: Card found busy in drop_dtr_rts.\n");
+               return;
+       }
+#ifdef ISICOM_DEBUG_DTR_RTS    
+       printk(KERN_DEBUG "ISICOM: drop_dtr_rts.\n");
+#endif 
+       outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
+       outw(0x0c04, base);
+       InterruptTheCard(base); 
+       port->status &= ~(ISI_RTS | ISI_DTR);
+}
+
+extern inline void kill_queue(struct isi_port * port, short queue)
+{
+       struct isi_board * card = port->card;
+       unsigned short base = card->base;
+       unsigned char channel = port->channel;
+       short wait=300;
+       while(((inw(base+0x0e) & 0x01) == 0) && (wait-- > 0));
+       if (wait <= 0) {
+               printk(KERN_WARNING "ISICOM: Card found busy in kill_queue.\n");
+               return;
+       }
+#ifdef ISICOM_DEBUG    
+       printk(KERN_DEBUG "ISICOM: kill_queue 0x%x.\n", queue);
+#endif 
+       outw(0x8000 | (channel << card->shift_count) | 0x02 , base);
+       outw((queue << 8) | 0x06, base);
+       InterruptTheCard(base); 
+}
+
+#endif /*      __KERNEL__      */
+
+#endif /*      ISICOM_H        */
\ No newline at end of file
index 5eed5ab0cc41522726cfa9119f3266c9251114d4..504b8657b0c29418b86de50366ff3c26df1191f0 100644 (file)
@@ -1,11 +1,12 @@
 #ifndef _LINUX_TYPES_H
 #define _LINUX_TYPES_H
 
-#ifdef __KERNEL__
+#if defined(__KERNEL__) && !defined(STDC_HEADERS)
 #if ((__GNUC_MINOR__ >= 8) || (__GNUC_MAJOR >=3))
 #warning "This code is tested with gcc 2.7.2.x only. Using egcs/gcc 2.8.x needs"
 #warning "additional patches that have not been sufficiently tested to include by"
 #warning "default."
+#warning "See http://www.suse.de/~florian/kernel+egcs.html for more information"
 #error "Remove this if you have applied the gcc 2.8/egcs patches and wish to use them"
 #endif
 #endif
index f9eb10641d2c354f5a995147955009c07d3a5e63..44d5a78287c95aa7bb0b8d9157bfb78c42776c3b 100644 (file)
@@ -949,7 +949,7 @@ asmlinkage void start_kernel(void)
        sti();
        check_bugs();
 
-#ifdef CONFIG_MTRR
+#if defined(CONFIG_MTRR) && defined(__SMP__)
        init_mtrr_config();
 #endif
 
index 7c7e1c0ad43fe30da272796fe88e3dea77fe4a65..f7eda6c4d236248fb22741c0ca3cf835afbc7c41 100644 (file)
@@ -314,7 +314,9 @@ static int try_to_unuse(unsigned int type)
                nr++;
        }
        free_page(page);
+#ifdef CONFIG_SYSVIPC  
        shm_unuse(type);
+#endif
        return 0;
 }
 
index 609ea6041052dc73d04d8eb0201cabef4088b819..7d73eac5c35c7064cf1882eeb613a7a4508dbe3b 100644 (file)
@@ -707,7 +707,7 @@ asmlinkage int sys_bind(int fd, struct sockaddr *umyaddr, int addrlen)
                err = 0;
 out:           
        sockfd_put(sock);
-       return(0);
+       return err;
 }