home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1996 May / PCOnline_05_1996.bin / linux / source / kernel-s / v1.3 / patch-1.009 / patch-1.3.15
Text File  |  1995-08-02  |  213KB  |  6,193 lines

  1. diff -u --recursive --new-file v1.3.14/linux/Makefile linux/Makefile
  2. --- v1.3.14/linux/Makefile    Mon Jul 31 15:58:59 1995
  3. +++ linux/Makefile    Tue Aug  1 10:33:02 1995
  4. @@ -1,6 +1,6 @@
  5.  VERSION = 1
  6.  PATCHLEVEL = 3
  7. -SUBLEVEL = 14
  8. +SUBLEVEL = 15
  9.  
  10.  ARCH = i386
  11.  
  12. diff -u --recursive --new-file v1.3.14/linux/arch/alpha/config.in linux/arch/alpha/config.in
  13. --- v1.3.14/linux/arch/alpha/config.in    Fri Jul  7 08:54:43 1995
  14. +++ linux/arch/alpha/config.in    Wed Aug  2 09:55:38 1995
  15. @@ -225,8 +225,7 @@
  16.  bool 'xiafs filesystem support' CONFIG_XIA_FS n
  17.  bool 'msdos fs support' CONFIG_MSDOS_FS y
  18.  if [ "$CONFIG_MSDOS_FS" = "y" ]; then
  19. -#bool 'umsdos: Unix like fs on top of std MSDOS FAT fs' CONFIG_UMSDOS_FS n
  20. -comment 'Umsdos is not supported in 1.3.0: wait for 1.3.1'
  21. +bool 'umsdos: Unix like fs on top of std MSDOS FAT fs' CONFIG_UMSDOS_FS n
  22.  fi
  23.  bool '/proc filesystem support' CONFIG_PROC_FS y
  24.  if [ "$CONFIG_INET" = "y" ]; then
  25. diff -u --recursive --new-file v1.3.14/linux/arch/i386/boot/tools/build.c linux/arch/i386/boot/tools/build.c
  26. --- v1.3.14/linux/arch/i386/boot/tools/build.c    Thu Jun 29 19:02:39 1995
  27. +++ linux/arch/i386/boot/tools/build.c    Tue Aug  1 10:02:30 1995
  28. @@ -76,7 +76,7 @@
  29.      return t.s[0];
  30.  }
  31.  
  32. -void die(char * str)
  33. +void die(const char * str)
  34.  {
  35.      fprintf(stderr,"%s\n",str);
  36.      exit(1);
  37. diff -u --recursive --new-file v1.3.14/linux/arch/i386/config.in linux/arch/i386/config.in
  38. --- v1.3.14/linux/arch/i386/config.in    Thu Jul 13 16:20:19 1995
  39. +++ linux/arch/i386/config.in    Wed Aug  2 09:41:45 1995
  40. @@ -180,7 +180,7 @@
  41.      fi
  42.      bool 'HP PCLAN+ (27247B and 27252A) support' CONFIG_HPLAN_PLUS n
  43.      bool 'HP PCLAN (27245 and other 27xxx series) support' CONFIG_HPLAN n
  44. -    bool 'HP 10/100VG PCLAN (257X series) support' CONFIG_HP100 y
  45. +    bool 'HP 10/100VG PCLAN (ISA, EISA, PCI) support' CONFIG_HP100 y
  46.      bool 'NE2000/NE1000 support' CONFIG_NE2000 y
  47.      bool 'SK_G16 support' CONFIG_SK_G16 n
  48.  fi
  49. diff -u --recursive --new-file v1.3.14/linux/arch/i386/kernel/bios32.c linux/arch/i386/kernel/bios32.c
  50. --- v1.3.14/linux/arch/i386/kernel/bios32.c    Wed Jun  7 13:10:01 1995
  51. +++ linux/arch/i386/kernel/bios32.c    Tue Aug  1 10:02:30 1995
  52. @@ -363,7 +363,7 @@
  53.      return (int) (ret & 0xff00) >> 8;
  54.  }
  55.  
  56. -char *pcibios_strerror (int error)
  57. +const char *pcibios_strerror (int error)
  58.  {
  59.      static char buf[80];
  60.  
  61. diff -u --recursive --new-file v1.3.14/linux/arch/i386/kernel/setup.c linux/arch/i386/kernel/setup.c
  62. --- v1.3.14/linux/arch/i386/kernel/setup.c    Thu Jun 29 19:02:39 1995
  63. +++ linux/arch/i386/kernel/setup.c    Tue Aug  1 10:02:30 1995
  64. @@ -103,7 +103,7 @@
  65.      init_task.mm->brk = TASK_SIZE + (unsigned long) &_end;
  66.  
  67.      for (;;) {
  68. -        if (c == ' ' && *(unsigned long *)from == *(unsigned long *)"mem=") {
  69. +        if (c == ' ' && *(const unsigned long *)from == *(const unsigned long *)"mem=") {
  70.              memory_end = simple_strtoul(from+4, &from, 0);
  71.              if ( *from == 'K' || *from == 'k' ) {
  72.                  memory_end = memory_end << 10;
  73. @@ -136,7 +136,7 @@
  74.  
  75.  int get_cpuinfo(char * buffer)
  76.  {
  77. -    char *model[2][9]={{"DX","SX","DX/2","4","SX/2","6",
  78. +    static const char *model[2][9]={{"DX","SX","DX/2","4","SX/2","6",
  79.                  "DX/2-WB","DX/4"},
  80.              {"Pentium 60/66","Pentium 90/100","3",
  81.                  "4","5","6","7","8"}};
  82. diff -u --recursive --new-file v1.3.14/linux/arch/i386/kernel/traps.c linux/arch/i386/kernel/traps.c
  83. --- v1.3.14/linux/arch/i386/kernel/traps.c    Thu Jun 29 19:02:39 1995
  84. +++ linux/arch/i386/kernel/traps.c    Tue Aug  1 10:02:30 1995
  85. @@ -93,7 +93,7 @@
  86.  #define VMALLOC_OFFSET (8*1024*1024)
  87.  #define MODULE_RANGE (8*1024*1024)
  88.  
  89. -/*static*/ void die_if_kernel(char * str, struct pt_regs * regs, long err)
  90. +/*static*/ void die_if_kernel(const char * str, struct pt_regs * regs, long err)
  91.  {
  92.      int i;
  93.      unsigned long esp;
  94. diff -u --recursive --new-file v1.3.14/linux/arch/i386/lib/checksum.c linux/arch/i386/lib/checksum.c
  95. --- v1.3.14/linux/arch/i386/lib/checksum.c    Fri Jul  7 13:42:57 1995
  96. +++ linux/arch/i386/lib/checksum.c    Tue Aug  1 10:02:30 1995
  97. @@ -23,7 +23,7 @@
  98.   * computes a partial checksum, e.g. for TCP/UDP fragments
  99.   */
  100.  
  101. -unsigned int csum_partial(unsigned char * buff, int len, unsigned int sum) {
  102. +unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) {
  103.        /*
  104.         * Experiments with ethernet and slip connections show that buff
  105.         * is aligned on either a 2-byte or 4-byte boundary.  We get at
  106. @@ -101,7 +101,7 @@
  107.   * copy from fs while checksumming, otherwise like csum_partial
  108.   */
  109.  
  110. -unsigned int csum_partial_copy_fromuser( char *src, char *dst, 
  111. +unsigned int csum_partial_copy_fromuser(const char *src, char *dst, 
  112.                    int len, int sum) {
  113.      __asm__("
  114.      testl $2, %%edi        # Check alignment.
  115. @@ -196,7 +196,7 @@
  116.   * copy from ds while checksumming, otherwise like csum_partial
  117.   */
  118.  
  119. -unsigned int csum_partial_copy( char *src, char *dst, 
  120. +unsigned int csum_partial_copy(const char *src, char *dst, 
  121.                    int len, int sum) {
  122.      __asm__("
  123.      testl $2, %%edi        # Check alignment.
  124. diff -u --recursive --new-file v1.3.14/linux/arch/i386/math-emu/errors.c linux/arch/i386/math-emu/errors.c
  125. --- v1.3.14/linux/arch/i386/math-emu/errors.c    Mon Aug  1 08:19:13 1994
  126. +++ linux/arch/i386/math-emu/errors.c    Tue Aug  1 10:02:31 1995
  127. @@ -85,7 +85,7 @@
  128.  void emu_printall()
  129.  {
  130.    int i;
  131. -  static char *tag_desc[] = { "Valid", "Zero", "ERROR", "ERROR",
  132. +  static const char *tag_desc[] = { "Valid", "Zero", "ERROR", "ERROR",
  133.                                "DeNorm", "Inf", "NaN", "Empty" };
  134.    unsigned char byte1, FPU_modrm;
  135.    unsigned long address = FPU_ORIG_EIP;
  136. @@ -212,7 +212,7 @@
  137.  
  138.  static struct {
  139.    int type;
  140. -  char *name;
  141. +  const char *name;
  142.  } exception_names[] = {
  143.    { EX_StackOver, "stack overflow" },
  144.    { EX_StackUnder, "stack underflow" },
  145. diff -u --recursive --new-file v1.3.14/linux/arch/i386/math-emu/fpu_emu.h linux/arch/i386/math-emu/fpu_emu.h
  146. --- v1.3.14/linux/arch/i386/math-emu/fpu_emu.h    Fri Jun 30 16:22:25 1995
  147. +++ linux/arch/i386/math-emu/fpu_emu.h    Tue Aug  1 10:02:31 1995
  148. @@ -133,9 +133,9 @@
  149.  
  150.  
  151.  #define reg_move(x, y) { \
  152. -         *(short *)&((y)->sign) = *(short *)&((x)->sign); \
  153. -         *(long *)&((y)->exp) = *(long *)&((x)->exp); \
  154. -         *(long long *)&((y)->sigl) = *(long long *)&((x)->sigl); }
  155. +         *(short *)&((y)->sign) = *(const short *)&((x)->sign); \
  156. +         *(long *)&((y)->exp) = *(const long *)&((x)->exp); \
  157. +         *(long long *)&((y)->sigl) = *(const long long *)&((x)->sigl); }
  158.  
  159.  #define significand(x) ( ((unsigned long long *)&((x)->sigl))[0] )
  160.  
  161. diff -u --recursive --new-file v1.3.14/linux/arch/i386/mm/fault.c linux/arch/i386/mm/fault.c
  162. --- v1.3.14/linux/arch/i386/mm/fault.c    Mon Jan 30 13:08:04 1995
  163. +++ linux/arch/i386/mm/fault.c    Tue Aug  1 10:02:31 1995
  164. @@ -20,7 +20,7 @@
  165.  #include <asm/segment.h>
  166.  #include <asm/pgtable.h>
  167.  
  168. -extern void die_if_kernel(char *,struct pt_regs *,long);
  169. +extern void die_if_kernel(const char *,struct pt_regs *,long);
  170.  
  171.  /*
  172.   * This routine handles page faults.  It determines the address,
  173. diff -u --recursive --new-file v1.3.14/linux/drivers/block/cdu31a.c linux/drivers/block/cdu31a.c
  174. --- v1.3.14/linux/drivers/block/cdu31a.c    Mon Jul 31 15:58:59 1995
  175. +++ linux/drivers/block/cdu31a.c    Wed Aug  2 09:10:40 1995
  176. @@ -380,20 +380,6 @@
  177.     outb(curr_control_reg, sony_cd_control_reg);
  178.  }
  179.  
  180. -static void
  181. -cdu31a_interrupt(int irq, struct pt_regs *regs)
  182. -{
  183. -   disable_interrupts();
  184. -   if (cdu31a_irq_wait != NULL)
  185. -   {
  186. -      wake_up(&cdu31a_irq_wait);
  187. -   }
  188. -   else
  189. -   {
  190. -      printk("CDU31A: Got an interrupt but nothing was waiting\n");
  191. -   }
  192. -}
  193. -
  194.  /*
  195.   * Wait a little while (used for polling the drive).  If in initialization,
  196.   * setting a timeout doesn't work, so just loop for a while.
  197. @@ -528,6 +514,50 @@
  198.     outb(cmd, sony_cd_cmd_reg);
  199.  }
  200.  
  201. +static void
  202. +cdu31a_interrupt(int irq, struct pt_regs *regs)
  203. +{
  204. +   unsigned char val;
  205. +
  206. +   if (abort_read_started)
  207. +   {
  208. +      /* We might be waiting for an abort to finish.  Don't
  209. +         disable interrupts yet, though, because we handle
  210. +         this one here. */
  211. +      /* Clear out the result registers. */
  212. +      while (is_result_reg_not_empty())
  213. +      {
  214. +         val = read_result_register();
  215. +      }
  216. +      clear_data_ready();
  217. +      clear_result_ready();
  218. +
  219. +      /* Clear out the data */
  220. +      while (is_data_requested())
  221. +      {
  222. +         val = read_data_register();
  223. +      }
  224. +      abort_read_started = 0;
  225. +
  226. +      /* If something was waiting, wake it up now. */
  227. +      if (cdu31a_irq_wait != NULL)
  228. +      {
  229. +         disable_interrupts();
  230. +         wake_up(&cdu31a_irq_wait);
  231. +      }
  232. +   }
  233. +   else if (cdu31a_irq_wait != NULL)
  234. +   {
  235. +      disable_interrupts();
  236. +      wake_up(&cdu31a_irq_wait);
  237. +   }
  238. +   else
  239. +   {
  240. +      disable_interrupts();
  241. +      printk("CDU31A: Got an interrupt but nothing was waiting\n");
  242. +   }
  243. +}
  244. +
  245.  /*
  246.   * Set the drive parameters so the drive will auto-spin-up when a
  247.   * disk is inserted.
  248. @@ -2270,7 +2300,7 @@
  249.  }
  250.  
  251.  static int
  252. -do_sony_cd_cmd_chk(char *name,
  253. +do_sony_cd_cmd_chk(const char *name,
  254.                     unsigned char cmd,
  255.                     unsigned char *params,
  256.                     unsigned int num_params,
  257. @@ -2788,7 +2818,7 @@
  258.  
  259.  
  260.  /* The different types of disc loading mechanisms supported */
  261. -static char *load_mech[] = { "caddy", "tray", "pop-up", "unknown" };
  262. +static const char *load_mech[] = { "caddy", "tray", "pop-up", "unknown" };
  263.  
  264.  static void
  265.  get_drive_configuration(unsigned short base_io,
  266. diff -u --recursive --new-file v1.3.14/linux/drivers/block/cm206.c linux/drivers/block/cm206.c
  267. --- v1.3.14/linux/drivers/block/cm206.c    Mon Jul 31 15:59:00 1995
  268. +++ linux/drivers/block/cm206.c    Tue Aug  1 10:02:31 1995
  269. @@ -1129,7 +1129,7 @@
  270.  #define ERROR  -EIO
  271.  
  272.  static int cm206[2] = {0,0};    /* for compatible `insmod' parameter passing */
  273. -void parse_options() 
  274. +void parse_options(void) 
  275.  {
  276.    int i;
  277.    for (i=0; i<2; i++) {
  278. diff -u --recursive --new-file v1.3.14/linux/drivers/block/floppy.c linux/drivers/block/floppy.c
  279. --- v1.3.14/linux/drivers/block/floppy.c    Mon Jul 31 15:59:00 1995
  280. +++ linux/drivers/block/floppy.c    Tue Aug  1 10:02:31 1995
  281. @@ -311,7 +311,7 @@
  282.   */
  283.  static struct {
  284.      struct floppy_drive_params params;
  285. -    char *name; /* name printed while booting */
  286. +    const char *name; /* name printed while booting */
  287.  } default_drive_params[]= {
  288.  /* NOTE: the time values in jiffies should be in msec!
  289.   CMOS drive type
  290. @@ -545,7 +545,7 @@
  291.  #endif
  292.  }
  293.  
  294. -static inline void debugt(char *message)
  295. +static inline void debugt(const char *message)
  296.  {
  297.  #ifdef DEBUGT
  298.    if ( DP->flags & DEBUGT )
  299. @@ -557,10 +557,10 @@
  300.  static struct timer_list fd_timeout ={ NULL, NULL, 0, 0, 
  301.                             (timeout_fn) floppy_shutdown };
  302.  
  303. -static char *timeout_message;
  304. +static const char *timeout_message;
  305.  
  306.  #ifdef CONFIG_FLOPPY_SANITY
  307. -static void is_alive(char *message)
  308. +static void is_alive(const char *message)
  309.  {
  310.      /* this routine checks whether the floppy driver is "alive" */
  311.      if (fdc_busy && command_status < 2 && !fd_timeout.prev){
  312. @@ -593,7 +593,7 @@
  313.  
  314.  
  315.  
  316. -static void reschedule_timeout(int drive, char *message, int marg)
  317. +static void reschedule_timeout(int drive, const char *message, int marg)
  318.  {
  319.      if (drive == CURRENTD )
  320.          drive = current_drive;
  321. @@ -2801,7 +2801,7 @@
  322.  #define COPYOUT(x) (fd_copyout( (void *)param, &(x), sizeof(x)))
  323.  #define COPYIN(x) (memcpy_fromfs( &(x), (void *) param, sizeof(x)),0)
  324.  
  325. -static char *drive_name(int type, int drive )
  326. +static const char *drive_name(int type, int drive )
  327.  {
  328.      struct floppy_struct *floppy;    
  329.  
  330. @@ -2924,7 +2924,7 @@
  331.      struct format_descr tmp_format_req;
  332.      int i,device,drive,type,cnt;
  333.      struct floppy_struct *this_floppy;
  334. -    char *name;
  335. +    const char *name;
  336.  
  337.      device = inode->i_rdev;
  338.      switch (cmd) {
  339. @@ -3151,7 +3151,7 @@
  340.  }
  341.  
  342.  static int floppy_write(struct inode * inode, struct file * filp,
  343. -            char * buf, int count)
  344. +            const char * buf, int count)
  345.  {
  346.      int block;
  347.      int ret;
  348. @@ -3523,7 +3523,7 @@
  349.  }
  350.          
  351.  static struct param_table {
  352. -    char *name;
  353. +    const char *name;
  354.      void (*fn)(int *ints, int param);
  355.      int def_param;
  356.  } config_params[]={
  357. diff -u --recursive --new-file v1.3.14/linux/drivers/block/genhd.c linux/drivers/block/genhd.c
  358. --- v1.3.14/linux/drivers/block/genhd.c    Mon Jul 31 15:59:00 1995
  359. +++ linux/drivers/block/genhd.c    Tue Aug  1 10:02:31 1995
  360. @@ -134,7 +134,7 @@
  361.       *  Check for Disk Manager v6.0x with geometry translation
  362.       */
  363.      if (!tested_for_dm6++) {    /* only check for DM6 *once* */
  364. -        extern int ide_xlate_1024(dev_t, int, char *);
  365. +        extern int ide_xlate_1024(dev_t, int, const char *);
  366.          /* check for DM6 with Dynamic Drive Overlay (DDO) */
  367.          if (p->sys_ind == DM6_PARTITION) {
  368.              /*
  369. diff -u --recursive --new-file v1.3.14/linux/drivers/block/ide.c linux/drivers/block/ide.c
  370. --- v1.3.14/linux/drivers/block/ide.c    Mon Jul 31 15:59:00 1995
  371. +++ linux/drivers/block/ide.c    Tue Aug  1 10:02:32 1995
  372. @@ -2178,7 +2178,7 @@
  373.      ide_setup (str, ints);
  374.  }
  375.  
  376. -int ide_xlate_1024 (dev_t full_dev, int need_offset, char *msg)
  377. +int ide_xlate_1024 (dev_t full_dev, int need_offset, const char *msg)
  378.  {
  379.      ide_dev_t *dev;
  380.      byte head_vals[] = {4, 8, 16, 32, 64, 128, 255, 0}, *heads = head_vals;
  381. diff -u --recursive --new-file v1.3.14/linux/drivers/block/sbpcd.c linux/drivers/block/sbpcd.c
  382. --- v1.3.14/linux/drivers/block/sbpcd.c    Mon Jul 31 15:59:00 1995
  383. +++ linux/drivers/block/sbpcd.c    Tue Aug  1 10:02:32 1995
  384. @@ -494,24 +494,24 @@
  385.  static unsigned char msgnum=0;
  386.  static char msgbuf[80];
  387.  
  388. -static char *str_sb = "SoundBlaster";
  389. -static char *str_sb_l = "soundblaster";
  390. -static char *str_lm = "LaserMate";
  391. -static char *str_sp = "SPEA";
  392. -static char *str_sp_l = "spea";
  393. -char *type;
  394. +static const char *str_sb = "SoundBlaster";
  395. +static const char *str_sb_l = "soundblaster";
  396. +static const char *str_lm = "LaserMate";
  397. +static const char *str_sp = "SPEA";
  398. +static const char *str_sp_l = "spea";
  399. +const char *type;
  400.  
  401.  #if !(SBPCD_ISSUE-1)
  402. -static char *major_name="sbpcd";
  403. +static const char *major_name="sbpcd";
  404.  #endif
  405.  #if !(SBPCD_ISSUE-2)
  406. -static char *major_name="sbpcd2";
  407. +static const char *major_name="sbpcd2";
  408.  #endif
  409.  #if !(SBPCD_ISSUE-3)
  410. -static char *major_name="sbpcd3";
  411. +static const char *major_name="sbpcd3";
  412.  #endif
  413.  #if !(SBPCD_ISSUE-4)
  414. -static char *major_name="sbpcd4";
  415. +static const char *major_name="sbpcd4";
  416.  #endif
  417.  
  418.  /*==========================================================================*/
  419. @@ -691,7 +691,7 @@
  420.  /*
  421.   * DDI interface
  422.   */
  423. -static void msg(int level, char *fmt, ...)
  424. +static void msg(int level, const char *fmt, ...)
  425.  {
  426.      char buf[256];
  427.      va_list args;
  428. @@ -4983,7 +4983,7 @@
  429.  #if (SBPCD_ISSUE-1)
  430.  static
  431.  #endif
  432. -void sbpcd_setup(char *s, int *p)
  433. +void sbpcd_setup(const char *s, int *p)
  434.  {
  435.      setup_done++;
  436.      msg(DBG_INI,"sbpcd_setup called with %04X,%s\n",p[1], s);
  437. diff -u --recursive --new-file v1.3.14/linux/drivers/char/atixlmouse.c linux/drivers/char/atixlmouse.c
  438. --- v1.3.14/linux/drivers/char/atixlmouse.c    Tue Jun 27 14:11:33 1995
  439. +++ linux/drivers/char/atixlmouse.c    Tue Aug  1 10:02:32 1995
  440. @@ -113,7 +113,7 @@
  441.  }
  442.  
  443.  
  444. -static int write_mouse(struct inode * inode, struct file * file, char * buffer, int count)
  445. +static int write_mouse(struct inode * inode, struct file * file, const char * buffer, int count)
  446.  {
  447.      return -EINVAL;
  448.  }
  449. diff -u --recursive --new-file v1.3.14/linux/drivers/char/busmouse.c linux/drivers/char/busmouse.c
  450. --- v1.3.14/linux/drivers/char/busmouse.c    Tue Jun 27 14:11:33 1995
  451. +++ linux/drivers/char/busmouse.c    Tue Aug  1 10:02:32 1995
  452. @@ -124,7 +124,7 @@
  453.   * writes are disallowed
  454.   */
  455.  
  456. -static int write_mouse(struct inode * inode, struct file * file, char * buffer, int count)
  457. +static int write_mouse(struct inode * inode, struct file * file, const char * buffer, int count)
  458.  {
  459.      return -EINVAL;
  460.  }
  461. diff -u --recursive --new-file v1.3.14/linux/drivers/char/console.c linux/drivers/char/console.c
  462. --- v1.3.14/linux/drivers/char/console.c    Fri Jun 30 16:22:26 1995
  463. +++ linux/drivers/char/console.c    Tue Aug  1 10:02:32 1995
  464. @@ -1006,7 +1006,7 @@
  465.      update_attr(currcons);
  466.  }
  467.  
  468. -static void respond_string(char * p, struct tty_struct * tty)
  469. +static void respond_string(const char * p, struct tty_struct * tty)
  470.  {
  471.      while (*p) {
  472.          tty_insert_flip_char(tty, *p, 0);
  473. @@ -1409,7 +1409,7 @@
  474.  }
  475.  
  476.  static int con_write(struct tty_struct * tty, int from_user,
  477. -             unsigned char *buf, int count)
  478. +             const unsigned char *buf, int count)
  479.  {
  480.      int c, tc, ok, n = 0;
  481.      unsigned int currcons;
  482. @@ -1991,7 +1991,7 @@
  483.   */
  484.  long con_init(long kmem_start)
  485.  {
  486. -    char *display_desc = "????";
  487. +    const char *display_desc = "????";
  488.      int currcons = 0;
  489.      int orig_x = ORIG_X;
  490.      int orig_y = ORIG_Y;
  491. diff -u --recursive --new-file v1.3.14/linux/drivers/char/cyclades.c linux/drivers/char/cyclades.c
  492. --- v1.3.14/linux/drivers/char/cyclades.c    Tue Jun 27 14:11:34 1995
  493. +++ linux/drivers/char/cyclades.c    Tue Aug  1 10:02:32 1995
  494. @@ -1561,7 +1561,7 @@
  495.   */
  496.  static int
  497.  cy_write(struct tty_struct * tty, int from_user,
  498. -           unsigned char *buf, int count)
  499. +          const unsigned char *buf, int count)
  500.  {
  501.    struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
  502.    unsigned long flags;
  503. diff -u --recursive --new-file v1.3.14/linux/drivers/char/keyboard.c linux/drivers/char/keyboard.c
  504. --- v1.3.14/linux/drivers/char/keyboard.c    Sat Jun 10 19:13:12 1995
  505. +++ linux/drivers/char/keyboard.c    Tue Aug  1 10:02:33 1995
  506. @@ -856,8 +856,8 @@
  507.  
  508.  static void do_pad(unsigned char value, char up_flag)
  509.  {
  510. -    static char *pad_chars = "0123456789+-*/\015,.?";
  511. -    static char *app_map = "pqrstuvwxylSRQMnn?";
  512. +    static const char *pad_chars = "0123456789+-*/\015,.?";
  513. +    static const char *app_map = "pqrstuvwxylSRQMnn?";
  514.  
  515.      if (up_flag)
  516.          return;        /* no action, if this is a key release */
  517. @@ -913,7 +913,7 @@
  518.  
  519.  static void do_cur(unsigned char value, char up_flag)
  520.  {
  521. -    static char *cur_chars = "BDCA";
  522. +    static const char *cur_chars = "BDCA";
  523.      if (up_flag)
  524.          return;
  525.  
  526. diff -u --recursive --new-file v1.3.14/linux/drivers/char/lp.c linux/drivers/char/lp.c
  527. --- v1.3.14/linux/drivers/char/lp.c    Mon Jul 31 15:59:01 1995
  528. +++ linux/drivers/char/lp.c    Tue Aug  1 10:02:33 1995
  529. @@ -157,7 +157,7 @@
  530.      wake_up(&lp->lp_wait_q);
  531.  }
  532.  
  533. -static int lp_write_interrupt(struct inode * inode, struct file * file, char * buf, int count)
  534. +static int lp_write_interrupt(struct inode * inode, struct file * file, const char * buf, int count)
  535.  {
  536.      unsigned int minor = MINOR(inode->i_rdev);
  537.      unsigned long copy_size;
  538. @@ -223,11 +223,12 @@
  539.  }
  540.  
  541.  static int lp_write_polled(struct inode * inode, struct file * file,
  542. -               char * buf, int count)
  543. +               const char * buf, int count)
  544.  {
  545.      int  retval;
  546.      unsigned int minor = MINOR(inode->i_rdev);
  547. -    char c, *temp = buf;
  548. +    char c;
  549. +    const char *temp = buf;
  550.  
  551.  #ifdef LP_DEBUG
  552.      if (jiffies-lp_last_call > LP_TIME(minor)) {
  553. @@ -296,7 +297,7 @@
  554.      return temp-buf;
  555.  }
  556.  
  557. -static int lp_write(struct inode * inode, struct file * file, char * buf, int count)
  558. +static int lp_write(struct inode * inode, struct file * file, const char * buf, int count)
  559.  {
  560.      if (LP_IRQ(MINOR(inode->i_rdev)))
  561.          return lp_write_interrupt(inode, file, buf, count);
  562. diff -u --recursive --new-file v1.3.14/linux/drivers/char/mem.c linux/drivers/char/mem.c
  563. --- v1.3.14/linux/drivers/char/mem.c    Tue Jun 27 14:11:34 1995
  564. +++ linux/drivers/char/mem.c    Tue Aug  1 10:02:33 1995
  565. @@ -30,7 +30,7 @@
  566.      return -EIO;
  567.  }
  568.  
  569. -static int write_ram(struct inode * inode, struct file * file,char * buf, int count)
  570. +static int write_ram(struct inode * inode, struct file * file, const char * buf, int count)
  571.  {
  572.      return -EIO;
  573.  }
  574. @@ -60,7 +60,7 @@
  575.      return read;
  576.  }
  577.  
  578. -static int write_mem(struct inode * inode, struct file * file,char * buf, int count)
  579. +static int write_mem(struct inode * inode, struct file * file,const char * buf, int count)
  580.  {
  581.      unsigned long p = file->f_pos;
  582.      int written;
  583. @@ -134,10 +134,10 @@
  584.      return tmp-buf;
  585.  }
  586.  
  587. -static int write_port(struct inode * inode,struct file * file,char * buf, int count)
  588. +static int write_port(struct inode * inode,struct file * file,const char * buf, int count)
  589.  {
  590.      unsigned int i = file->f_pos;
  591. -    char * tmp = buf;
  592. +    const char * tmp = buf;
  593.  
  594.      while (count-- > 0 && i < 65536) {
  595.          outb(get_user(tmp),i);
  596. @@ -153,7 +153,7 @@
  597.      return 0;
  598.  }
  599.  
  600. -static int write_null(struct inode * inode,struct file * file,char * buf, int count)
  601. +static int write_null(struct inode * inode,struct file * file, const char * buf, int count)
  602.  {
  603.      return count;
  604.  }
  605. @@ -183,7 +183,7 @@
  606.      return count;
  607.  }
  608.  
  609. -static int write_full(struct inode * inode,struct file * file,char * buf, int count)
  610. +static int write_full(struct inode * inode,struct file * file, const char * buf, int count)
  611.  {
  612.      return -ENOSPC;
  613.  }
  614. diff -u --recursive --new-file v1.3.14/linux/drivers/char/msbusmouse.c linux/drivers/char/msbusmouse.c
  615. --- v1.3.14/linux/drivers/char/msbusmouse.c    Tue Jun 27 14:11:34 1995
  616. +++ linux/drivers/char/msbusmouse.c    Tue Aug  1 10:02:33 1995
  617. @@ -96,7 +96,7 @@
  618.  }
  619.  
  620.  
  621. -static int write_mouse(struct inode * inode, struct file * file, char * buffer, int count)
  622. +static int write_mouse(struct inode * inode, struct file * file, const char * buffer, int count)
  623.  {
  624.      return -EINVAL;
  625.  }
  626. diff -u --recursive --new-file v1.3.14/linux/drivers/char/n_tty.c linux/drivers/char/n_tty.c
  627. --- v1.3.14/linux/drivers/char/n_tty.c    Tue Jun 27 14:11:34 1995
  628. +++ linux/drivers/char/n_tty.c    Tue Aug  1 10:02:33 1995
  629. @@ -525,10 +525,10 @@
  630.      put_tty_queue(c, tty);
  631.  }    
  632.  
  633. -static void n_tty_receive_buf(struct tty_struct *tty, unsigned char *cp,
  634. +static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp,
  635.                    char *fp, int count)
  636.  {
  637. -    unsigned char *p;
  638. +    const unsigned char *p;
  639.      char *f, flags = 0;
  640.      int    i;
  641.  
  642. @@ -912,11 +912,11 @@
  643.  }
  644.  
  645.  static int write_chan(struct tty_struct * tty, struct file * file,
  646. -              unsigned char * buf, unsigned int nr)
  647. +              const unsigned char * buf, unsigned int nr)
  648.  {
  649.      struct wait_queue wait = { current, NULL };
  650.      int c;
  651. -    unsigned char *b = buf;
  652. +    const unsigned char *b = buf;
  653.      int retval = 0;
  654.  
  655.      /* Job control check -- must be done at start (POSIX.1 7.1.1.4). */
  656. diff -u --recursive --new-file v1.3.14/linux/drivers/char/psaux.c linux/drivers/char/psaux.c
  657. --- v1.3.14/linux/drivers/char/psaux.c    Mon Jul 31 15:59:01 1995
  658. +++ linux/drivers/char/psaux.c    Tue Aug  1 10:02:33 1995
  659. @@ -372,7 +372,7 @@
  660.   * Write to the aux device.
  661.   */
  662.  
  663. -static int write_aux(struct inode * inode, struct file * file, char * buffer, int count)
  664. +static int write_aux(struct inode * inode, struct file * file, const char * buffer, int count)
  665.  {
  666.      int i = count;
  667.  
  668. @@ -394,7 +394,7 @@
  669.   * Write to the 82C710 mouse device.
  670.   */
  671.  
  672. -static int write_qp(struct inode * inode, struct file * file, char * buffer, int count)
  673. +static int write_qp(struct inode * inode, struct file * file, const char * buffer, int count)
  674.  {
  675.      int i = count;
  676.  
  677. diff -u --recursive --new-file v1.3.14/linux/drivers/char/pty.c linux/drivers/char/pty.c
  678. --- v1.3.14/linux/drivers/char/pty.c    Mon Apr 10 09:01:15 1995
  679. +++ linux/drivers/char/pty.c    Tue Aug  1 10:02:33 1995
  680. @@ -110,7 +110,7 @@
  681.  }
  682.  
  683.  static int pty_write(struct tty_struct * tty, int from_user,
  684. -               unsigned char *buf, int count)
  685. +               const unsigned char *buf, int count)
  686.  {
  687.      struct tty_struct *to = tty->link;
  688.      int    c=0, n, r;
  689. diff -u --recursive --new-file v1.3.14/linux/drivers/char/scc.c linux/drivers/char/scc.c
  690. --- v1.3.14/linux/drivers/char/scc.c    Tue Jul 18 16:28:57 1995
  691. +++ linux/drivers/char/scc.c    Tue Aug  1 10:02:33 1995
  692. @@ -98,7 +98,7 @@
  693.  
  694.  int scc_open(struct tty_struct *tty, struct file *filp);
  695.  static void scc_close(struct tty_struct *tty, struct file *filp);
  696. -int scc_write(struct tty_struct *tty, int from_user, unsigned char *buf, int count);
  697. +int scc_write(struct tty_struct *tty, int from_user, const unsigned char *buf, int count);
  698.  static void scc_put_char(struct tty_struct *tty, unsigned char ch);
  699.  static void scc_flush_chars(struct tty_struct *tty);
  700.  static int scc_write_room(struct tty_struct *tty);
  701. @@ -1988,7 +1988,7 @@
  702.  /* ----> tx routine: decode KISS data and scc_enqueue it <---- */
  703.  
  704.  /* send raw frame to SCC. used for AX.25 */
  705. -int scc_write(struct tty_struct *tty, int from_user, unsigned char *buf, int count)
  706. +int scc_write(struct tty_struct *tty, int from_user, const unsigned char *buf, int count)
  707.  {
  708.      unsigned long flags;
  709.      static unsigned char *p;
  710. diff -u --recursive --new-file v1.3.14/linux/drivers/char/serial.c linux/drivers/char/serial.c
  711. --- v1.3.14/linux/drivers/char/serial.c    Tue Jun 27 14:11:35 1995
  712. +++ linux/drivers/char/serial.c    Tue Aug  1 10:02:33 1995
  713. @@ -1293,7 +1293,7 @@
  714.  }
  715.  
  716.  static int rs_write(struct tty_struct * tty, int from_user,
  717. -            unsigned char *buf, int count)
  718. +            const unsigned char *buf, int count)
  719.  {
  720.      int    c, total = 0;
  721.      struct async_struct *info = (struct async_struct *)tty->driver_data;
  722. diff -u --recursive --new-file v1.3.14/linux/drivers/char/tpqic02.c linux/drivers/char/tpqic02.c
  723. --- v1.3.14/linux/drivers/char/tpqic02.c    Mon Jan 23 23:04:09 1995
  724. +++ linux/drivers/char/tpqic02.c    Tue Aug  1 10:02:34 1995
  725. @@ -339,7 +339,7 @@
  726.  
  727.  
  728.  /* This translates minor numbers to the corresponding recording format: */
  729. -static char *format_names[] = {
  730. +static const char *format_names[] = {
  731.      "not set",    /* for dumb drives unable to handle format selection */
  732.      "11",        /* extinct */
  733.      "24",
  734. @@ -371,7 +371,7 @@
  735.   */
  736.  static struct exception_list_type {
  737.      unsigned short mask, code;
  738. -    char *msg;
  739. +    const char *msg;
  740.      /* EXC_nr attribute should match with tpqic02.h */
  741.  } exception_list[] = {
  742.      {0, 0,
  743. @@ -424,7 +424,7 @@
  744.  
  745.  
  746.  
  747. -static void tpqputs(unsigned long flags, char *s)
  748. +static void tpqputs(unsigned long flags, const char *s)
  749.  {
  750.      if ((flags & TPQD_ALWAYS) || (flags & QIC02_TAPE_DEBUG))
  751.          printk(TPQIC02_NAME ": %s\n", s);
  752. @@ -2090,7 +2090,7 @@
  753.   * tape device again. The driver will detect an exception status in (No Cartridge)
  754.   * and force a rewind. After that tar may continue writing.
  755.   */
  756. -static int qic02_tape_write(struct inode * inode, struct file * filp, char * buf, int count)
  757. +static int qic02_tape_write(struct inode * inode, struct file * filp, const char * buf, int count)
  758.  {
  759.      int error;
  760.      dev_t dev = inode->i_rdev;
  761. @@ -2163,7 +2163,7 @@
  762.  
  763.          /* copy from user to DMA buffer and initiate transfer. */
  764.          if (bytes_todo>0) {
  765. -            memcpy_fromfs( (void *) buffaddr, (void *) buf, bytes_todo);
  766. +            memcpy_fromfs( (void *) buffaddr, (const void *) buf, bytes_todo);
  767.  
  768.  /****************** similar problem with read() at FM could happen here at EOT.
  769.   ******************/
  770. @@ -2427,14 +2427,6 @@
  771.  } /* qic02_tape_open */
  772.  
  773.  
  774. -
  775. -static int qic02_tape_readdir(struct inode * inode, struct file * filp, struct dirent * dp, int count)
  776. -{
  777. -    return -ENOTDIR;    /* not supported */
  778. -} /* qic02_tape_readdir */
  779. -
  780. -
  781. -
  782.  static void qic02_tape_release(struct inode * inode, struct file * filp)
  783.  {
  784.      dev_t dev = inode->i_rdev;
  785. @@ -2791,7 +2783,7 @@
  786.      qic02_tape_lseek,        /* not allowed */
  787.      qic02_tape_read,        /* read */
  788.      qic02_tape_write,        /* write */
  789. -    qic02_tape_readdir,        /* not allowed */
  790. +    NULL,                /* readdir not allowed */
  791.      NULL,                /* select ??? */
  792.      qic02_tape_ioctl,        /* ioctl */
  793.      NULL,                /* mmap not allowed */
  794. diff -u --recursive --new-file v1.3.14/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c
  795. --- v1.3.14/linux/drivers/char/tty_io.c    Tue Jun 27 14:11:35 1995
  796. +++ linux/drivers/char/tty_io.c    Tue Aug  1 10:02:35 1995
  797. @@ -94,7 +94,7 @@
  798.  static void initialize_tty_struct(struct tty_struct *tty);
  799.  
  800.  static int tty_read(struct inode *, struct file *, char *, int);
  801. -static int tty_write(struct inode *, struct file *, char *, int);
  802. +static int tty_write(struct inode *, struct file *, const char *, int);
  803.  static int tty_select(struct inode *, struct file *, int, select_table *);
  804.  static int tty_open(struct inode *, struct file *);
  805.  static void tty_release(struct inode *, struct file *);
  806. @@ -292,7 +292,7 @@
  807.      return 0;
  808.  }
  809.  
  810. -static int hung_up_tty_write(struct inode * inode, struct file * file, char * buf, int count)
  811. +static int hung_up_tty_write(struct inode * inode, struct file * file, const char * buf, int count)
  812.  {
  813.      return -EIO;
  814.  }
  815. @@ -720,7 +720,7 @@
  816.      return i;
  817.  }
  818.  
  819. -static int tty_write(struct inode * inode, struct file * file, char * buf, int count)
  820. +static int tty_write(struct inode * inode, struct file * file, const char * buf, int count)
  821.  {
  822.      int i, is_console;
  823.      struct tty_struct * tty;
  824. @@ -748,7 +748,7 @@
  825.  #endif
  826.      if (tty->ldisc.write)
  827.          /* XXX casts are for what kernel-wide prototypes should be. */
  828. -        i = (tty->ldisc.write)(tty,file,(unsigned char *)buf,(unsigned int)count);
  829. +        i = (tty->ldisc.write)(tty,file,(const unsigned char *)buf,(unsigned int)count);
  830.      else
  831.          i = -EIO;
  832.      if (i > 0)
  833. @@ -1681,7 +1681,7 @@
  834.      int    retval;
  835.      struct tty_driver *p;
  836.      int    found = 0;
  837. -    char *othername = NULL;
  838. +    const char *othername = NULL;
  839.      
  840.      if (*driver->refcount)
  841.          return -EBUSY;
  842. diff -u --recursive --new-file v1.3.14/linux/drivers/char/vc_screen.c linux/drivers/char/vc_screen.c
  843. --- v1.3.14/linux/drivers/char/vc_screen.c    Tue Jun 27 14:11:35 1995
  844. +++ linux/drivers/char/vc_screen.c    Tue Aug  1 10:02:35 1995
  845. @@ -118,12 +118,12 @@
  846.  }
  847.  
  848.  static int
  849. -vcs_write(struct inode *inode, struct file *file, char *buf, int count)
  850. +vcs_write(struct inode *inode, struct file *file, const char *buf, int count)
  851.  {
  852.      unsigned long p = file->f_pos;
  853.      unsigned int cons = MINOR(inode->i_rdev);
  854.      int viewed, attr, size, written;
  855. -    char *buf0;
  856. +    const char *buf0;
  857.      unsigned short *org;
  858.  
  859.      attr = (cons & 128);
  860. @@ -169,7 +169,7 @@
  861.              org++;
  862.          }
  863.          while (count > 1) {
  864. -            scr_writew(get_user((unsigned short *) buf), org++);
  865. +            scr_writew(get_user((const unsigned short *) buf), org++);
  866.              buf += 2;
  867.              count -= 2;
  868.          }
  869. diff -u --recursive --new-file v1.3.14/linux/drivers/char/vt.c linux/drivers/char/vt.c
  870. --- v1.3.14/linux/drivers/char/vt.c    Mon Jul 31 15:59:01 1995
  871. +++ linux/drivers/char/vt.c    Tue Aug  1 10:02:35 1995
  872. @@ -424,7 +424,7 @@
  873.  
  874.          if (!perm)
  875.              return -EPERM;
  876. -        i = verify_area(VERIFY_READ, (void *)a, sizeof(struct kbentry));
  877. +        i = verify_area(VERIFY_READ, (const void *)a, sizeof(struct kbentry));
  878.          if (i)
  879.              return i;
  880.          if ((i = get_user(&a->kb_index)) >= NR_KEYS)
  881. diff -u --recursive --new-file v1.3.14/linux/drivers/net/3c501.c linux/drivers/net/3c501.c
  882. --- v1.3.14/linux/drivers/net/3c501.c    Fri Jul  7 08:54:46 1995
  883. +++ linux/drivers/net/3c501.c    Tue Aug  1 10:02:35 1995
  884. @@ -75,7 +75,7 @@
  885.      
  886.  */
  887.  
  888. -static char *version =
  889. +static const char *version =
  890.      "3c501.c: 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov).\n";
  891.  
  892.  /*
  893. @@ -223,7 +223,7 @@
  894.  {
  895.      #ifndef MODULE
  896.  
  897. -    char *mname;        /* Vendor name */
  898. +    const char *mname;        /* Vendor name */
  899.      unsigned char station_addr[6];
  900.      int autoirq = 0;
  901.      int i;
  902. diff -u --recursive --new-file v1.3.14/linux/drivers/net/3c503.c linux/drivers/net/3c503.c
  903. --- v1.3.14/linux/drivers/net/3c503.c    Fri Apr 28 16:56:52 1995
  904. +++ linux/drivers/net/3c503.c    Tue Aug  1 10:02:35 1995
  905. @@ -22,7 +22,7 @@
  906.      The Crynwr 3c503 packet driver.
  907.  */
  908.  
  909. -static char *version =
  910. +static const char *version =
  911.      "3c503.c:v1.10 9/23/93  Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
  912.  
  913.  #include <linux/kernel.h>
  914. diff -u --recursive --new-file v1.3.14/linux/drivers/net/3c505.c linux/drivers/net/3c505.c
  915. --- v1.3.14/linux/drivers/net/3c505.c    Fri Jul  7 08:54:46 1995
  916. +++ linux/drivers/net/3c505.c    Tue Aug  1 10:02:35 1995
  917. @@ -57,30 +57,30 @@
  918.   *
  919.   *********************************************************/
  920.  
  921. -static char * filename = __FILE__;
  922. +static const char * filename = __FILE__;
  923.  
  924. -static char * null_msg = "*** NULL at %s:%s (line %d) ***\n";
  925. +static const char * null_msg = "*** NULL at %s:%s (line %d) ***\n";
  926.  #define CHECK_NULL(p) \
  927.      if (!p) printk(null_msg, filename,__FUNCTION__,__LINE__)
  928.  
  929. -static char * timeout_msg = "*** timeout at %s:%s (line %d) ***\n";
  930. +static const char * timeout_msg = "*** timeout at %s:%s (line %d) ***\n";
  931.  #define TIMEOUT_MSG(lineno) \
  932.      printk(timeout_msg, filename,__FUNCTION__,(lineno))
  933.  
  934. -static char * invalid_pcb_msg =
  935. +static const char * invalid_pcb_msg =
  936.      "*** invalid pcb length %d at %s:%s (line %d) ***\n";
  937.  #define INVALID_PCB_MSG(len) \
  938.      printk(invalid_pcb_msg, (len),filename,__FUNCTION__,__LINE__)
  939.  
  940. -static char * search_msg = "%s: Looking for 3c505 adapter at address %#x...";
  941. +static const char * search_msg = "%s: Looking for 3c505 adapter at address %#x...";
  942.  
  943. -static char * stilllooking_msg = "still looking...";
  944. +static const char * stilllooking_msg = "still looking...";
  945.  
  946. -static char * found_msg = "found.\n";
  947. +static const char * found_msg = "found.\n";
  948.  
  949. -static char * notfound_msg = "not found (reason = %d)\n";
  950. +static const char * notfound_msg = "not found (reason = %d)\n";
  951.  
  952. -static char * couldnot_msg = "%s: 3c505 not found\n";
  953. +static const char * couldnot_msg = "%s: 3c505 not found\n";
  954.  
  955.  /*********************************************************
  956.   *
  957. @@ -1261,7 +1261,7 @@
  958.  {
  959.      int timeout;
  960.      int addr=dev->base_addr;
  961. -    char *name=dev->name;
  962. +    const char *name=dev->name;
  963.  
  964.      byte orig_HCR=inb_control(addr),
  965.          orig_HSR=inb_status(addr);
  966. diff -u --recursive --new-file v1.3.14/linux/drivers/net/3c507.c linux/drivers/net/3c507.c
  967. --- v1.3.14/linux/drivers/net/3c507.c    Fri Jul  7 08:54:46 1995
  968. +++ linux/drivers/net/3c507.c    Tue Aug  1 10:02:35 1995
  969. @@ -23,7 +23,7 @@
  970.      The statistics need to be updated correctly.
  971.  */
  972.  
  973. -static char *version =
  974. +static const char *version =
  975.      "3c507.c:v1.10 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
  976.  
  977.  #include <linux/config.h>
  978. diff -u --recursive --new-file v1.3.14/linux/drivers/net/3c509.c linux/drivers/net/3c509.c
  979. --- v1.3.14/linux/drivers/net/3c509.c    Fri Jul  7 08:54:46 1995
  980. +++ linux/drivers/net/3c509.c    Tue Aug  1 10:02:35 1995
  981. @@ -24,7 +24,7 @@
  982.      practice this rarely happens.
  983.  */
  984.  
  985. -static char *version = "3c509.c:1.03 10/8/94 becker@cesdis.gsfc.nasa.gov\n";
  986. +static const  char *version = "3c509.c:1.03 10/8/94 becker@cesdis.gsfc.nasa.gov\n";
  987.  
  988.  #include <linux/config.h>
  989.  #ifdef MODULE
  990. @@ -227,7 +227,7 @@
  991.      request_region(dev->base_addr, 16,"3c509");
  992.  
  993.      {
  994. -        char *if_names[] = {"10baseT", "AUI", "undefined", "BNC"};
  995. +        const char *if_names[] = {"10baseT", "AUI", "undefined", "BNC"};
  996.          printk("%s: 3c509 at %#3.3lx tag %d, %s port, address ",
  997.                 dev->name, dev->base_addr, current_tag, if_names[dev->if_port]);
  998.      }
  999. diff -u --recursive --new-file v1.3.14/linux/drivers/net/8390.c linux/drivers/net/8390.c
  1000. --- v1.3.14/linux/drivers/net/8390.c    Fri Jul  7 08:54:46 1995
  1001. +++ linux/drivers/net/8390.c    Tue Aug  1 10:02:35 1995
  1002. @@ -22,7 +22,7 @@
  1003.  
  1004.    */
  1005.  
  1006. -static char *version =
  1007. +static const char *version =
  1008.      "8390.c:v1.10 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
  1009.  
  1010.  /*
  1011. diff -u --recursive --new-file v1.3.14/linux/drivers/net/8390.h linux/drivers/net/8390.h
  1012. --- v1.3.14/linux/drivers/net/8390.h    Tue Jun 20 09:10:32 1995
  1013. +++ linux/drivers/net/8390.h    Tue Aug  1 10:02:35 1995
  1014. @@ -37,7 +37,7 @@
  1015.     things in there should be here!) */
  1016.  /* You have one of these per-board */
  1017.  struct ei_device {
  1018. -  char *name;
  1019. +  const char *name;
  1020.    void (*reset_8390)(struct device *);
  1021.    void (*block_output)(struct device *, int, const unsigned char *, int);
  1022.    int  (*block_input)(struct device *, int, char *, int);
  1023. diff -u --recursive --new-file v1.3.14/linux/drivers/net/ac3200.c linux/drivers/net/ac3200.c
  1024. --- v1.3.14/linux/drivers/net/ac3200.c    Thu Jan  5 13:55:40 1995
  1025. +++ linux/drivers/net/ac3200.c    Tue Aug  1 10:02:35 1995
  1026. @@ -14,7 +14,7 @@
  1027.      by glee@ardnassak.math.clemson.edu.
  1028.    */
  1029.  
  1030. -static char *version =
  1031. +static const char *version =
  1032.      "ac3200.c:v1.01 7/1/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
  1033.  
  1034.  #include <linux/kernel.h>
  1035. @@ -44,7 +44,7 @@
  1036.  static unsigned char config2irqmap[8] = {15, 12, 11, 10, 9, 7, 5, 3};
  1037.  static int addrmap[8] =
  1038.  {0xFF0000, 0xFE0000, 0xFD0000, 0xFFF0000, 0xFFE0000, 0xFFC0000,  0xD0000, 0 };
  1039. -static char *port_name[4] = { "10baseT", "invalid", "AUI", "10base2"};
  1040. +static const char *port_name[4] = { "10baseT", "invalid", "AUI", "10base2"};
  1041.  
  1042.  #define config2irq(configval)    config2irqmap[((configval) >> 3) & 7]
  1043.  #define config2mem(configval)    addrmap[(configval) & 7]
  1044. diff -u --recursive --new-file v1.3.14/linux/drivers/net/apricot.c linux/drivers/net/apricot.c
  1045. --- v1.3.14/linux/drivers/net/apricot.c    Fri Jun 30 16:22:26 1995
  1046. +++ linux/drivers/net/apricot.c    Tue Aug  1 10:02:35 1995
  1047. @@ -19,7 +19,7 @@
  1048.  
  1049.  */
  1050.  
  1051. -static char *version = "apricot.c:v0.2 05/12/94\n";
  1052. +static const char *version = "apricot.c:v0.2 05/12/94\n";
  1053.  
  1054.  #ifdef MODULE
  1055.  #include <linux/module.h>
  1056. diff -u --recursive --new-file v1.3.14/linux/drivers/net/arcnet.c linux/drivers/net/arcnet.c
  1057. --- v1.3.14/linux/drivers/net/arcnet.c    Thu Jul 13 16:20:20 1995
  1058. +++ linux/drivers/net/arcnet.c    Tue Aug  1 10:02:36 1995
  1059. @@ -119,7 +119,7 @@
  1060.           <jojo@repas.de>
  1061.  */
  1062.  
  1063. -static char *version =
  1064. +static const char *version =
  1065.   "arcnet.c:v1.92 ALPHA 95/07/11 Avery Pennarun <apenwarr@foxnet.net>\n";
  1066.   
  1067.  /**************************************************************************/
  1068. diff -u --recursive --new-file v1.3.14/linux/drivers/net/at1700.c linux/drivers/net/at1700.c
  1069. --- v1.3.14/linux/drivers/net/at1700.c    Fri Jul  7 08:54:47 1995
  1070. +++ linux/drivers/net/at1700.c    Tue Aug  1 10:02:36 1995
  1071. @@ -28,7 +28,7 @@
  1072.      response to inb()s from other device probes!
  1073.  */
  1074.  
  1075. -static char *version =
  1076. +static const char *version =
  1077.      "at1700.c:v1.12 1/18/95  Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
  1078.  
  1079.  #include <linux/config.h>
  1080. @@ -228,7 +228,7 @@
  1081.         0x1800 == use coax interface
  1082.         */
  1083.      {
  1084. -        char *porttype[] = {"auto-sense", "10baseT", "auto-sense", "10base2"};
  1085. +        const char *porttype[] = {"auto-sense", "10baseT", "auto-sense", "10base2"};
  1086.          ushort setup_value = read_eeprom(ioaddr, 12);
  1087.  
  1088.          dev->if_port = setup_value >> 8;
  1089. diff -u --recursive --new-file v1.3.14/linux/drivers/net/atp.c linux/drivers/net/atp.c
  1090. --- v1.3.14/linux/drivers/net/atp.c    Mon Jul 31 15:59:01 1995
  1091. +++ linux/drivers/net/atp.c    Tue Aug  1 10:02:36 1995
  1092. @@ -18,7 +18,7 @@
  1093.      The timer-based reset code was written by Bill Carlson, wwc@super.org.
  1094.  */
  1095.  
  1096. -static char *version =
  1097. +static const char *version =
  1098.      "atp.c:v1.01 1/18/95 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
  1099.  
  1100.  /*
  1101. diff -u --recursive --new-file v1.3.14/linux/drivers/net/de4x5.c linux/drivers/net/de4x5.c
  1102. --- v1.3.14/linux/drivers/net/de4x5.c    Tue Jul 25 18:21:21 1995
  1103. +++ linux/drivers/net/de4x5.c    Tue Aug  1 10:02:36 1995
  1104. @@ -141,7 +141,7 @@
  1105.      =========================================================================
  1106.  */
  1107.  
  1108. -static char *version = "de4x5.c:v0.32 6/26/95 davies@wanton.lkg.dec.com\n";
  1109. +static const char *version = "de4x5.c:v0.32 6/26/95 davies@wanton.lkg.dec.com\n";
  1110.  
  1111.  #include <linux/config.h>
  1112.  #ifdef MODULE
  1113. @@ -2163,7 +2163,7 @@
  1114.  static int EISA_signature(char *name, s32 eisa_id)
  1115.  {
  1116.    u_int i;
  1117. -  char *signatures[] = DE4X5_SIGNATURE;
  1118. +  const char *signatures[] = DE4X5_SIGNATURE;
  1119.    char ManCode[DE4X5_STRLEN];
  1120.    union {
  1121.      s32 ID;
  1122. diff -u --recursive --new-file v1.3.14/linux/drivers/net/de600.c linux/drivers/net/de600.c
  1123. --- v1.3.14/linux/drivers/net/de600.c    Fri Jul  7 08:54:47 1995
  1124. +++ linux/drivers/net/de600.c    Tue Aug  1 10:02:36 1995
  1125. @@ -1,4 +1,4 @@
  1126. -static char *version =
  1127. +static const char *version =
  1128.      "de600.c: $Revision: 1.40 $,  Bjorn Ekwall (bj0rn@blox.se)\n";
  1129.  /*
  1130.   *    de600.c
  1131. diff -u --recursive --new-file v1.3.14/linux/drivers/net/de620.c linux/drivers/net/de620.c
  1132. --- v1.3.14/linux/drivers/net/de620.c    Fri Jul  7 08:54:47 1995
  1133. +++ linux/drivers/net/de620.c    Tue Aug  1 10:02:36 1995
  1134. @@ -38,7 +38,7 @@
  1135.   *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
  1136.   *
  1137.   *****************************************************************************/
  1138. -static char *version =
  1139. +static const char *version =
  1140.      "de620.c: $Revision: 1.31 $,  Bjorn Ekwall <bj0rn@blox.se>\n";
  1141.  
  1142.  /***********************************************************************
  1143. diff -u --recursive --new-file v1.3.14/linux/drivers/net/depca.c linux/drivers/net/depca.c
  1144. --- v1.3.14/linux/drivers/net/depca.c    Tue Jul 25 18:21:21 1995
  1145. +++ linux/drivers/net/depca.c    Tue Aug  1 10:02:36 1995
  1146. @@ -186,7 +186,7 @@
  1147.      =========================================================================
  1148.  */
  1149.  
  1150. -static char *version = "depca.c:v0.41 5/26/95 davies@wanton.lkg.dec.com\n";
  1151. +static const char *version = "depca.c:v0.41 5/26/95 davies@wanton.lkg.dec.com\n";
  1152.  
  1153.  #include <linux/config.h>
  1154.  #ifdef MODULE
  1155. @@ -1438,7 +1438,7 @@
  1156.  static void DepcaSignature(char *name, u_long paddr)
  1157.  {
  1158.    u_int i,j,k;
  1159. -  char *signatures[] = DEPCA_SIGNATURE;
  1160. +  const char *signatures[] = DEPCA_SIGNATURE;
  1161.    char tmpstr[16];
  1162.  
  1163.    for (i=0;i<16;i++) {                  /* copy the first 16 bytes of ROM to */
  1164. @@ -1622,7 +1622,7 @@
  1165.  static int EISA_signature(char *name, s32 eisa_id)
  1166.  {
  1167.    u_int i;
  1168. -  char *signatures[] = DEPCA_SIGNATURE;
  1169. +  const char *signatures[] = DEPCA_SIGNATURE;
  1170.    char ManCode[DEPCA_STRLEN];
  1171.    union {
  1172.      s32 ID;
  1173. diff -u --recursive --new-file v1.3.14/linux/drivers/net/e2100.c linux/drivers/net/e2100.c
  1174. --- v1.3.14/linux/drivers/net/e2100.c    Mon Jan  9 07:56:29 1995
  1175. +++ linux/drivers/net/e2100.c    Tue Aug  1 10:02:36 1995
  1176. @@ -31,7 +31,7 @@
  1177.      If this happens, you must power down the machine for about 30 seconds.
  1178.  */
  1179.  
  1180. -static char *version =
  1181. +static const char *version =
  1182.      "e2100.c:v1.01 7/21/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
  1183.  
  1184.  #include <linux/kernel.h>
  1185. diff -u --recursive --new-file v1.3.14/linux/drivers/net/eepro.c linux/drivers/net/eepro.c
  1186. --- v1.3.14/linux/drivers/net/eepro.c    Fri Jul  7 08:54:47 1995
  1187. +++ linux/drivers/net/eepro.c    Tue Aug  1 10:02:36 1995
  1188. @@ -51,7 +51,7 @@
  1189.  
  1190.  */
  1191.  
  1192. -static char *version =
  1193. +static const char *version =
  1194.      "eepro.c: v0.07a 6/5/95 Bao C. Ha (bao@saigon.async.com)\n";
  1195.  
  1196.  /* Always include 'config.h' first in case the user wants to turn on
  1197. @@ -313,7 +313,7 @@
  1198.      int i;
  1199.      int eepro;    /* a flag, TRUE=1 for the EtherExpress Pro/10,
  1200.                 FALSE = 0 for other 82595-based lan cards. */
  1201. -    char *ifmap[] = {"AUI", "10Base2", "10BaseT"};
  1202. +    const char *ifmap[] = {"AUI", "10Base2", "10BaseT"};
  1203.      enum iftype { AUI=0, BNC=1, TPE=2 };
  1204.  
  1205.      /* Now, we are going to check for the signature of the
  1206. diff -u --recursive --new-file v1.3.14/linux/drivers/net/eexpress.c linux/drivers/net/eexpress.c
  1207. --- v1.3.14/linux/drivers/net/eexpress.c    Fri Jul  7 08:54:47 1995
  1208. +++ linux/drivers/net/eexpress.c    Tue Aug  1 10:02:36 1995
  1209. @@ -22,7 +22,7 @@
  1210.          Changed to support io= irq= by Alan Cox <Alan.Cox@linux.org>
  1211.  */
  1212.  
  1213. -static char *version =
  1214. +static const char *version =
  1215.      "eexpress.c:v0.07 1/19/94 Donald Becker (becker@super.org)\n";
  1216.  
  1217.  #include <linux/config.h>
  1218. @@ -375,7 +375,7 @@
  1219.         interface to minimize bogus bug reports. */
  1220.      {
  1221.          char irqmap[] = {0, 9, 3, 4, 5, 10, 11, 0};
  1222. -        char *ifmap[] = {"AUI", "BNC", "10baseT"};
  1223. +        const char *ifmap[] = {"AUI", "BNC", "10baseT"};
  1224.          enum iftype {AUI=0, BNC=1, TP=2};
  1225.          unsigned short setupval = read_eeprom(ioaddr, 0);
  1226.  
  1227. diff -u --recursive --new-file v1.3.14/linux/drivers/net/eql.c linux/drivers/net/eql.c
  1228. --- v1.3.14/linux/drivers/net/eql.c    Mon Jul 31 15:59:01 1995
  1229. +++ linux/drivers/net/eql.c    Tue Aug  1 10:02:36 1995
  1230. @@ -16,7 +16,7 @@
  1231.   *    Phone: 1-703-847-0040 ext 103
  1232.   */
  1233.  
  1234. -static char *version = 
  1235. +static const char *version = 
  1236.      "Equalizer: $Revision: 3.12 $ $Date: 1995/01/19 $ Simon Janes (simon@ncm.com)\n";
  1237.  
  1238.  #include <linux/config.h>
  1239. diff -u --recursive --new-file v1.3.14/linux/drivers/net/ewrk3.c linux/drivers/net/ewrk3.c
  1240. --- v1.3.14/linux/drivers/net/ewrk3.c    Fri Jul  7 08:54:47 1995
  1241. +++ linux/drivers/net/ewrk3.c    Tue Aug  1 10:02:37 1995
  1242. @@ -126,7 +126,7 @@
  1243.      =========================================================================
  1244.  */
  1245.  
  1246. -static char *version = "ewrk3.c:v0.32 1/16/95 davies@wanton.lkg.dec.com\n";
  1247. +static const char *version = "ewrk3.c:v0.32 1/16/95 davies@wanton.lkg.dec.com\n";
  1248.  
  1249.  #ifdef MODULE
  1250.  #include <linux/module.h>
  1251. diff -u --recursive --new-file v1.3.14/linux/drivers/net/hp-plus.c linux/drivers/net/hp-plus.c
  1252. --- v1.3.14/linux/drivers/net/hp-plus.c    Mon Jan  9 07:56:29 1995
  1253. +++ linux/drivers/net/hp-plus.c    Tue Aug  1 10:02:37 1995
  1254. @@ -18,7 +18,7 @@
  1255.      programming information.
  1256.  */
  1257.  
  1258. -static char *version =
  1259. +static const char *version =
  1260.  "hp-plus.c:v1.10 9/24/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
  1261.  
  1262.  #include <linux/string.h>        /* Important -- this inlines word moves. */
  1263. @@ -144,7 +144,7 @@
  1264.  {
  1265.      int i;
  1266.      unsigned char checksum = 0;
  1267. -    char *name = "HP-PC-LAN+";
  1268. +    const char *name = "HP-PC-LAN+";
  1269.      int mem_start;
  1270.  
  1271.      /* Check for the HP+ signature, 50 48 0x 53. */
  1272. diff -u --recursive --new-file v1.3.14/linux/drivers/net/hp.c linux/drivers/net/hp.c
  1273. --- v1.3.14/linux/drivers/net/hp.c    Mon Jan  9 07:56:28 1995
  1274. +++ linux/drivers/net/hp.c    Tue Aug  1 10:02:37 1995
  1275. @@ -18,7 +18,7 @@
  1276.        The Crynwr packet driver.
  1277.  */
  1278.  
  1279. -static char *version =
  1280. +static const char *version =
  1281.      "hp.c:v1.10 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
  1282.  
  1283.  #include <linux/kernel.h>
  1284. @@ -100,7 +100,7 @@
  1285.  int hp_probe1(struct device *dev, int ioaddr)
  1286.  {
  1287.      int i, board_id, wordmode;
  1288. -    char *name;
  1289. +    const char *name;
  1290.  
  1291.      /* Check for the HP physical address, 08 00 09 xx xx xx. */
  1292.      /* This really isn't good enough: we may pick up HP LANCE boards
  1293. diff -u --recursive --new-file v1.3.14/linux/drivers/net/hp100.c linux/drivers/net/hp100.c
  1294. --- v1.3.14/linux/drivers/net/hp100.c    Tue Jul 18 16:28:57 1995
  1295. +++ linux/drivers/net/hp100.c    Wed Aug  2 09:43:02 1995
  1296. @@ -10,6 +10,7 @@
  1297.   *    HP 27248B    10 only EISA card with Cascade chip
  1298.   *    HP J2577    10/100 EISA card with Cascade chip
  1299.   *    HP J2573    10/100 ISA card with Cascade chip
  1300. + *    HP J2585    10/100 PCI card
  1301.   *
  1302.   * Other ATT2MD01 Chip based boards might be supported in the future
  1303.   * (there are some minor changes needed).
  1304. @@ -53,7 +54,8 @@
  1305.   * TO DO:
  1306.   * ======
  1307.   *       - ioctl handling - some runtime setup things
  1308. - *       - PCI card support
  1309. + *       - high priority communications support
  1310. + *       - memory mapped access support for PCI cards
  1311.   *
  1312.   * Revision history:
  1313.   * =================
  1314. @@ -66,6 +68,8 @@
  1315.   *                Little bug in hp100_close function fixed.
  1316.   *                          100Mb/s connection debugged.
  1317.   *      0.12    14-Jul-95   Link down is now handled better.
  1318. + *      0.20    01-Aug-95   Added PCI support for HP J2585A card.
  1319. + *                          Statistics bug fixed.
  1320.   *
  1321.   */
  1322.  
  1323. @@ -81,6 +85,8 @@
  1324.  #include <linux/ioport.h>
  1325.  #include <linux/malloc.h>
  1326.  #include <linux/interrupt.h>
  1327. +#include <linux/pci.h>
  1328. +#include <linux/bios32.h>
  1329.  #include <asm/bitops.h>
  1330.  #include <asm/io.h>
  1331.  
  1332. @@ -96,6 +102,12 @@
  1333.   *  defines
  1334.   */
  1335.  
  1336. +#define HP100_BUS_ISA        0
  1337. +#define HP100_BUS_EISA        1
  1338. +#define HP100_BUS_PCI        2
  1339. +
  1340. +#define HP100_REGION_SIZE    0x20
  1341. +
  1342.  #define HP100_MAX_PACKET_SIZE    (1536+4)
  1343.  #define HP100_MIN_PACKET_SIZE    60
  1344.  
  1345. @@ -110,7 +122,8 @@
  1346.  
  1347.  struct hp100_eisa_id {
  1348.    u_int id;
  1349. -  char *name;
  1350. +  const char *name;
  1351. +  u_char bus;
  1352.  };
  1353.  
  1354.  struct hp100_private {
  1355. @@ -118,28 +131,39 @@
  1356.    u_short soft_model;
  1357.    u_int memory_size;
  1358.    u_short rx_ratio;
  1359. +  short mem_mapped;            /* memory mapped access */
  1360. +  u_char *mem_ptr;            /* pointer to memory mapped area */
  1361.    short lan_type;            /* 10Mb/s, 100Mb/s or -1 (error) */
  1362. -  int hub_status;            /* login to hub successfull? */
  1363. +  int hub_status;            /* login to hub was successfull? */
  1364.    u_char mac1_mode;
  1365.    u_char mac2_mode;
  1366.    struct enet_statistics stats;
  1367.  };
  1368.  
  1369. -struct hp100_rx_look {
  1370. -  struct hp100_rx_header header;
  1371. -  char something[ 24 ];            /* 2 * MAC @6 + protocol @2+8 + pad to 4 byte */
  1372. -};
  1373. -
  1374.  /*
  1375.   *  variables
  1376.   */
  1377.   
  1378.  static struct hp100_eisa_id hp100_eisa_ids[] = {
  1379. -  { 0x080F1F022, "HP J2577 rev A" }, /* 10/100 EISA card with REVA Cascade chip */
  1380. -  { 0x050F1F022, "HP J2573 rev A" }, /* 10/100 ISA card with REVA Cascade chip */
  1381. -  { 0x02019F022, "HP 27248B" },         /* 10 only EISA card with Cascade chip */
  1382. -  { 0x04019F022, "HP J2577" },         /* 10/100 EISA card with Cascade chip */
  1383. -  { 0x05019F022, "HP J2573" }         /* 10/100 ISA card with Cascade chip */
  1384. +
  1385. +  /* 10/100 EISA card with REVA Cascade chip */
  1386. +  { 0x080F1F022, "HP J2577 rev A", HP100_BUS_EISA }, 
  1387. +
  1388. +  /* 10/100 ISA card with REVA Cascade chip */
  1389. +  { 0x050F1F022, "HP J2573 rev A", HP100_BUS_ISA },
  1390. +
  1391. +  /* 10 only EISA card with Cascade chip */
  1392. +  { 0x02019F022, "HP 27248B",      HP100_BUS_EISA }, 
  1393. +
  1394. +  /* 10/100 EISA card with Cascade chip */
  1395. +  { 0x04019F022, "HP J2577",       HP100_BUS_EISA },
  1396. +
  1397. +  /* 10/100 ISA card with Cascade chip */
  1398. +  { 0x05019F022, "HP J2573",       HP100_BUS_ISA },
  1399. +
  1400. +  /* 10/100 PCI card */
  1401. +  /* Note: ID for this card is same as PCI vendor/device numbers. */
  1402. +  { 0x01030103c, "HP J2585",        HP100_BUS_PCI },
  1403.  };
  1404.  
  1405.  #ifdef MODULE
  1406. @@ -150,21 +174,18 @@
  1407.   *  prototypes
  1408.   */
  1409.  
  1410. -static int hp100_probe1( struct device *dev, int ioaddr );
  1411. +static int hp100_probe1( struct device *dev, int ioaddr, int bus );
  1412.  static int hp100_open( struct device *dev );
  1413.  static int hp100_close( struct device *dev );
  1414.  static int hp100_start_xmit( struct sk_buff *skb, struct device *dev );
  1415.  static void hp100_rx( struct device *dev );
  1416.  static struct enet_statistics *hp100_get_stats( struct device *dev );
  1417.  static void hp100_update_stats( struct device *dev );
  1418. +static void hp100_clear_stats( int ioaddr );
  1419.  #ifdef HAVE_MULTICAST
  1420.  static void hp100_set_multicast_list( struct device *dev, int num_addrs, void *addrs );
  1421.  #endif
  1422. -#ifndef LINUX_1_1_52
  1423.  static void hp100_interrupt( int irq, struct pt_regs *regs );
  1424. -#else
  1425. -static void hp100_interrupt( int irq );
  1426. -#endif
  1427.  
  1428.  static void hp100_start_interface( struct device *dev );
  1429.  static void hp100_stop_interface( struct device *dev );
  1430. @@ -181,36 +202,97 @@
  1431.  {
  1432.    int base_addr = dev ? dev -> base_addr : 0;
  1433.    int ioaddr;
  1434. -        
  1435. +#ifdef CONFIG_PCI
  1436. +  int pci_start_index = 0;
  1437. +#endif
  1438. +
  1439.    if ( base_addr > 0xff )    /* Check a single specified location. */
  1440. -    return hp100_probe1(dev, base_addr);
  1441. +    {
  1442. +      if ( check_region( base_addr, HP100_REGION_SIZE ) ) return -EINVAL;
  1443. +      if ( base_addr < 0x400 )
  1444. +        return hp100_probe1( dev, base_addr, HP100_BUS_ISA );
  1445. +       else
  1446. +        return hp100_probe1( dev, base_addr, HP100_BUS_EISA );
  1447. +    }
  1448.     else 
  1449. +#ifdef CONFIG_PCI
  1450. +  if ( base_addr > 0 && base_addr < 8 + 1 )
  1451. +    pci_start_index = 0x100 | ( base_addr - 1 );
  1452. +   else
  1453. +#endif
  1454.      if ( base_addr != 0 ) return -ENXIO;
  1455. +
  1456. +  /* at first - scan PCI bus(es) */
  1457. +  
  1458. +#ifdef CONFIG_PCI
  1459. +  if ( pcibios_present() )
  1460. +    {
  1461. +      int pci_index;
  1462. +      
  1463. +#ifdef HP100_DEBUG_PCI
  1464. +      printk( "hp100: PCI BIOS is present, checking for devices..\n" );
  1465. +#endif
  1466. +      for ( pci_index = pci_start_index & 7; pci_index < 8; pci_index++ )
  1467. +        {
  1468. +          u_char pci_bus, pci_device_fn;
  1469. +          u_short pci_command;
  1470. +          
  1471. +          if ( pcibios_find_device( PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585A,
  1472. +                          pci_index, &pci_bus,
  1473. +                          &pci_device_fn ) != 0 ) break;
  1474. +          pcibios_read_config_dword( pci_bus, pci_device_fn,
  1475. +                                   PCI_BASE_ADDRESS_0, &ioaddr );
  1476. +                               
  1477. +          ioaddr &= ~3;        /* remove I/O space marker in bit 0. */
  1478. +              
  1479. +          if ( check_region( ioaddr, HP100_REGION_SIZE ) ) continue;
  1480. +              
  1481. +          pcibios_read_config_word( pci_bus, pci_device_fn,
  1482. +                              PCI_COMMAND, &pci_command );
  1483. +          if ( !( pci_command & PCI_COMMAND_MASTER ) )
  1484. +            {
  1485. +#ifdef HP100_DEBUG_PCI
  1486. +              printk( "hp100: PCI Master Bit has not been set. Setting...\n" );
  1487. +#endif
  1488. +              pci_command |= PCI_COMMAND_MASTER;
  1489. +              pcibios_write_config_word( pci_bus, pci_device_fn,
  1490. +                               PCI_COMMAND, pci_command );
  1491. +            }
  1492. +#ifdef HP100_DEBUG_PCI
  1493. +          printk( "hp100: PCI adapter found at 0x%x\n", ioaddr );
  1494. +#endif
  1495. +             if ( hp100_probe1( dev, ioaddr, HP100_BUS_PCI ) == 0 ) return 0;
  1496. +        }
  1497. +    }
  1498. +  if ( pci_start_index > 0 ) return -ENODEV;
  1499. +#endif /* CONFIG_PCI */
  1500.           
  1501. -  /* at first - probe all EISA possible port regions (if EISA bus present) */
  1502. +  /* at second - probe all EISA possible port regions (if EISA bus present) */
  1503.    
  1504.    for ( ioaddr = 0x1c38; EISA_bus && ioaddr < 0x10000; ioaddr += 0x400 )
  1505.      {
  1506. -      if ( check_region( ioaddr, 0x20 ) ) continue;
  1507. -      if ( hp100_probe1( dev, ioaddr ) == 0 ) return 0;
  1508. +      if ( check_region( ioaddr, HP100_REGION_SIZE ) ) continue;
  1509. +      if ( hp100_probe1( dev, ioaddr, HP100_BUS_EISA ) == 0 ) return 0;
  1510.      }
  1511.           
  1512. -  /* at second - probe all ISA possible port regions */
  1513. +  /* at third - probe all ISA possible port regions */
  1514.           
  1515.    for ( ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x20 )
  1516.      {
  1517. -      if ( check_region( ioaddr, 0x20 ) ) continue;
  1518. -      if ( hp100_probe1( dev, ioaddr ) == 0 ) return 0;
  1519. +      if ( check_region( ioaddr, HP100_REGION_SIZE ) ) continue;
  1520. +      if ( hp100_probe1( dev, ioaddr, HP100_BUS_ISA ) == 0 ) return 0;
  1521.      }
  1522.                                                                              
  1523.    return -ENODEV;
  1524.  }
  1525.  
  1526. -static int hp100_probe1( struct device *dev, int ioaddr )
  1527. +static int hp100_probe1( struct device *dev, int ioaddr, int bus )
  1528.  {
  1529.    int i;
  1530. -  u_char uc;
  1531. +  u_char uc, uc_1;
  1532.    u_int eisa_id;
  1533. +  short mem_mapped;
  1534. +  u_char *mem_ptr;
  1535.    struct hp100_private *lp;
  1536.    struct hp100_eisa_id *eid;
  1537.  
  1538. @@ -222,11 +304,12 @@
  1539.        return EIO;
  1540.      }
  1541.  
  1542. -  if ( inb( ioaddr + 0 ) != HP100_HW_ID_0 ||
  1543. -       inb( ioaddr + 1 ) != HP100_HW_ID_1 ||
  1544. -       ( inb( ioaddr + 2 ) & 0xf0 ) != HP100_HW_ID_2_REVA ||
  1545. -       inb( ioaddr + 3 ) != HP100_HW_ID_3 ) 
  1546. -     return -ENODEV;
  1547. +  if ( bus != HP100_BUS_PCI )        /* don't check PCI cards again */
  1548. +    if ( inb( ioaddr + 0 ) != HP100_HW_ID_0 ||
  1549. +         inb( ioaddr + 1 ) != HP100_HW_ID_1 ||
  1550. +         ( inb( ioaddr + 2 ) & 0xf0 ) != HP100_HW_ID_2_REVA ||
  1551. +         inb( ioaddr + 3 ) != HP100_HW_ID_3 ) 
  1552. +       return -ENODEV;
  1553.  
  1554.    dev -> base_addr = ioaddr;
  1555.  
  1556. @@ -238,8 +321,9 @@
  1557.    for ( i = uc = eisa_id = 0; i < 4; i++ )
  1558.      {
  1559.        eisa_id >>= 8;
  1560. -      eisa_id |= ( hp100_inb( BOARD_ID + i ) ) << 24;
  1561. -      uc += eisa_id >> 24;
  1562. +      uc_1 = hp100_inb( BOARD_ID + i );
  1563. +      eisa_id |= uc_1 << 24;
  1564. +      uc += uc_1;
  1565.      }
  1566.    uc += hp100_inb( BOARD_ID + 4 );
  1567.  
  1568. @@ -258,7 +342,7 @@
  1569.        break;
  1570.    if ( i >= sizeof( hp100_eisa_ids ) / sizeof( struct hp100_eisa_id ) )
  1571.      {
  1572. -      printk( "hp100_probe1: card at port 0x%x isn't known\n", ioaddr );
  1573. +      printk( "hp100_probe1: card at port 0x%x isn't known (id = 0x%x)\n", ioaddr, eisa_id );
  1574.        return -ENODEV;
  1575.      }
  1576.    eid = &hp100_eisa_ids[ i ];
  1577. @@ -278,13 +362,35 @@
  1578.        return -EIO;
  1579.      }
  1580.  
  1581. +#ifndef HP100_IO_MAPPED
  1582.    hp100_page( HW_MAP );
  1583. -  if ( hp100_inw( OPTION_LSW ) & ( HP100_MEM_EN | HP100_BM_WRITE | HP100_BM_READ ) )
  1584. -    {
  1585. -      printk( "hp100_probe1: memory mapped io isn't supported (card %s at port 0x%x)\n",
  1586. -          eid -> name, ioaddr );
  1587. -      return -EIO;
  1588. +  mem_mapped = ( hp100_inw( OPTION_LSW ) & 
  1589. +                 ( HP100_MEM_EN | HP100_BM_WRITE | HP100_BM_READ ) ) != 0;
  1590. +  mem_ptr = NULL;
  1591. +  if ( mem_mapped )
  1592. +    {
  1593. +      mem_ptr = (u_char *)( hp100_inw( MEM_MAP_LSW ) | 
  1594. +                            ( hp100_inw( MEM_MAP_MSW ) << 16 ) );
  1595. +      (u_int)mem_ptr &= ~0x1fff;    /* 8k aligment */
  1596. +      if ( bus == HP100_BUS_ISA && ( (u_int)mem_ptr & ~0xfffff ) != 0 )
  1597. +        {
  1598. +          mem_ptr = NULL;
  1599. +          mem_mapped = 0;
  1600. +        }
  1601. +      if ( mem_mapped && bus == HP100_BUS_PCI )
  1602. +        {
  1603. +#if 0
  1604. +          printk( "writeb !!!\n" );
  1605. +          writeb( 0, mem_ptr );
  1606. +#endif
  1607. +          mem_ptr = NULL;
  1608. +          mem_mapped = 0;
  1609. +        }
  1610.      }
  1611. +#else
  1612. +  mem_mapped = 0;
  1613. +  mem_ptr = NULL;
  1614. +#endif
  1615.  
  1616.    if ( ( dev -> priv = kmalloc( sizeof( struct hp100_private ), GFP_KERNEL ) ) == NULL )
  1617.      return -ENOMEM;
  1618. @@ -292,6 +398,8 @@
  1619.  
  1620.    lp = (struct hp100_private *)dev -> priv;
  1621.    lp -> id = eid;
  1622. +  lp -> mem_mapped = mem_mapped;
  1623. +  lp -> mem_ptr = mem_ptr;
  1624.    hp100_page( ID_MAC_ADDR );
  1625.    lp -> soft_model = hp100_inb( SOFT_MODEL );
  1626.    lp -> mac1_mode = HP100_MAC1MODE3;
  1627. @@ -316,28 +424,46 @@
  1628.    dev -> set_multicast_list = &hp100_set_multicast_list;
  1629.  #endif
  1630.  
  1631. -#ifndef LINUX_1_1_52
  1632. -  request_region( dev -> base_addr, 0x20, eid -> name );
  1633. -#endif
  1634. +  request_region( dev -> base_addr, HP100_REGION_SIZE, eid -> name );
  1635.  
  1636.    hp100_page( ID_MAC_ADDR );
  1637.    for ( i = uc = 0; i < 6; i++ )
  1638.      dev -> dev_addr[ i ] = hp100_inb( LAN_ADDR + i );
  1639.  
  1640. +  hp100_clear_stats( ioaddr );
  1641. +
  1642.    ether_setup( dev );
  1643.  
  1644.    lp -> lan_type = hp100_sense_lan( dev );
  1645.       
  1646. -  printk( "%s: %s at 0x%x, IRQ %d, %dkB SRAM (rx/tx %d%%), ",
  1647. -    dev -> name, lp -> id -> name, ioaddr, dev -> irq, 
  1648. +  printk( "%s: %s at 0x%x, IRQ %d, ",
  1649. +    dev -> name, lp -> id -> name, ioaddr, dev -> irq );
  1650. +  switch ( bus ) {
  1651. +    case HP100_BUS_EISA: printk( "EISA" ); break;
  1652. +    case HP100_BUS_PCI:  printk( "PCI" );  break;
  1653. +    default:         printk( "ISA" );  break;
  1654. +  }
  1655. +  printk( " bus, %dk SRAM (rx/tx %d%%).\n",
  1656.      lp -> memory_size >> ( 10 - 4 ), lp -> rx_ratio );
  1657. +  if ( mem_mapped )
  1658. +    printk( "%s: Memory mapped access used at 0x%x-0x%x.\n", 
  1659. +        dev -> name, (u_int)mem_ptr, (u_int)mem_ptr + 0x1fff );
  1660. +  printk( "%s: ", dev -> name );
  1661. +  if ( lp -> lan_type != HP100_LAN_ERR )
  1662. +    printk( "Adapter is attached to " );
  1663.    switch ( lp -> lan_type ) {
  1664. -    case HP100_LAN_100: printk( "100Mb/s VG TP" ); break;
  1665. -    case HP100_LAN_10:  printk( "10Mb/s TP" );     break;
  1666. -    default:            printk( "link down" );     break;
  1667. +    case HP100_LAN_100:
  1668. +      printk( "100Mb/s Voice Grade AnyLAN network.\n" );
  1669. +      break;
  1670. +    case HP100_LAN_10:
  1671. +      printk( "10Mb/s network.\n" );
  1672. +      break;
  1673. +    default:
  1674. +      printk( "Warning! Link down.\n" );
  1675.    }
  1676. -  printk( ".\n" );
  1677. -
  1678. +        
  1679. +  hp100_stop_interface( dev );
  1680. +  
  1681.    return 0;
  1682.  }
  1683.  
  1684. @@ -372,10 +498,9 @@
  1685.    lp -> mac2_mode = HP100_MAC2MODE3;
  1686.    
  1687.    hp100_page( MAC_CTRL );
  1688. -  hp100_orw( HP100_LINK_BEAT_DIS, LAN_CFG_10 );
  1689. +  hp100_orw( HP100_LINK_BEAT_DIS | HP100_RESET_LB, LAN_CFG_10 );
  1690.  
  1691.    hp100_stop_interface( dev );
  1692. -  hp100_reset_card();
  1693.    hp100_load_eeprom( dev );
  1694.  
  1695.    hp100_outw( HP100_MMAP_DIS | HP100_SET_HB | 
  1696. @@ -388,7 +513,7 @@
  1697.  #else
  1698.    hp100_outw( HP100_ADV_NXT_PKT | HP100_TX_CMD | HP100_RESET_LB, OPTION_MSW );
  1699.  #endif
  1700. -
  1701. +                              
  1702.    hp100_page( MAC_ADDRESS );
  1703.    for ( i = 0; i < 6; i++ )
  1704.      hp100_outb( dev -> dev_addr[ i ], MAC_ADDR + i );
  1705. @@ -396,7 +521,7 @@
  1706.      hp100_outb( 0xff, HASH_BYTE0 + i );
  1707.    hp100_page( PERFORMANCE );
  1708.    hp100_outw( 0xfefe, IRQ_MASK );    /* mask off all ints */
  1709. -  hp100_outw( 0xffff, IRQ_STATUS );    /* ack */
  1710. +  hp100_outw( 0xffff, IRQ_STATUS );    /* ack IRQ */
  1711.    hp100_outw( (HP100_RX_PACKET | HP100_RX_ERROR | HP100_SET_HB) |
  1712.                (HP100_TX_ERROR | HP100_SET_LB ), IRQ_MASK );
  1713.                                /* and enable few */
  1714. @@ -521,30 +646,48 @@
  1715.        printk( "hp100_start_xmit: busy\n" );
  1716.  #endif    
  1717.      }
  1718. -    
  1719. +
  1720.    hp100_ints_off();
  1721.    val = hp100_inw( IRQ_STATUS );
  1722.    hp100_outw( val & HP100_TX_COMPLETE, IRQ_STATUS );
  1723.  #ifdef HP100_DEBUG_TX
  1724.    printk( "hp100_start_xmit: irq_status = 0x%x, len = %d\n", val, (int)skb -> len );
  1725.  #endif
  1726. -  if ( skb -> len >= HP100_MIN_PACKET_SIZE )
  1727. +  if ( lp -> mem_mapped )
  1728.      {
  1729. -      hp100_outw( skb -> len, DATA32 );        /* length to memory manager */
  1730. -      hp100_outw( skb -> len, FRAGMENT_LEN );
  1731. -      outsl( ioaddr + HP100_REG_DATA32, skb -> data, ( skb -> len + 3 ) >> 2 );
  1732. -      hp100_outw( HP100_TX_CMD | HP100_SET_LB, OPTION_MSW ); /* send packet */
  1733. +      if ( skb -> len >= HP100_MIN_PACKET_SIZE )
  1734. +        {
  1735. +          hp100_outw( skb -> len, DATA32 );    /* length to memory manager */
  1736. +          hp100_outw( skb -> len, FRAGMENT_LEN );
  1737. +          memcpy_toio( lp -> mem_ptr, skb -> data, skb -> len );
  1738. +        }
  1739. +       else
  1740. +        {
  1741. +          hp100_outw( HP100_MIN_PACKET_SIZE, DATA32 ); /* length to memory manager */
  1742. +          hp100_outw( HP100_MIN_PACKET_SIZE, FRAGMENT_LEN );
  1743. +          memcpy_toio( lp -> mem_ptr, skb -> data, skb -> len );
  1744. +          memset_io( lp -> mem_ptr, 0, HP100_MIN_PACKET_SIZE - skb -> len );
  1745. +        }
  1746.      }
  1747.     else
  1748.      {
  1749. -      hp100_outw( HP100_MIN_PACKET_SIZE, DATA32 ); /* length to memory manager */
  1750. -      hp100_outw( HP100_MIN_PACKET_SIZE, FRAGMENT_LEN );
  1751. -      i = skb -> len + 3;
  1752. -      outsl( ioaddr + HP100_REG_DATA32, skb -> data, i >> 2 );
  1753. -      for ( i &= ~3; i < HP100_MIN_PACKET_SIZE; i += 4 ) 
  1754. -        hp100_outl( 0, DATA32 );
  1755. -      hp100_outw( HP100_TX_CMD | HP100_SET_LB, OPTION_MSW ); /* send packet */
  1756. +      if ( skb -> len >= HP100_MIN_PACKET_SIZE )
  1757. +        {
  1758. +          hp100_outw( skb -> len, DATA32 );    /* length to memory manager */
  1759. +          hp100_outw( skb -> len, FRAGMENT_LEN );
  1760. +          outsl( ioaddr + HP100_REG_DATA32, skb -> data, ( skb -> len + 3 ) >> 2 );
  1761. +        }
  1762. +       else
  1763. +        {
  1764. +          hp100_outw( HP100_MIN_PACKET_SIZE, DATA32 ); /* length to memory manager */
  1765. +          hp100_outw( HP100_MIN_PACKET_SIZE, FRAGMENT_LEN );
  1766. +          i = skb -> len + 3;
  1767. +          outsl( ioaddr + HP100_REG_DATA32, skb -> data, i >> 2 );
  1768. +          for ( i &= ~3; i < HP100_MIN_PACKET_SIZE; i += 4 ) 
  1769. +            hp100_outl( 0, DATA32 );
  1770. +        }
  1771.      }
  1772. +  hp100_outw( HP100_TX_CMD | HP100_SET_LB, OPTION_MSW ); /* send packet */
  1773.    lp -> stats.tx_packets++;
  1774.    dev -> trans_start = jiffies;
  1775.    hp100_ints_on();
  1776. @@ -592,7 +735,7 @@
  1777.            printk( "hp100_rx: busy, remaining packets = %d\n", packets );
  1778.  #endif    
  1779.          }
  1780. -      header = hp100_inl( DATA32 );
  1781. +      header = lp -> mem_mapped ? readl( lp -> mem_ptr ) : hp100_inl( DATA32 );
  1782.        pkt_len = header & HP100_PKT_LEN_MASK;
  1783.  #ifdef HP100_DEBUG_RX
  1784.        printk( "hp100_rx: new packet - length = %d, errors = 0x%x, dest = 0x%x\n",
  1785. @@ -603,7 +746,7 @@
  1786.         * allocating more than asked (notably, aligning the request up to
  1787.         * the next 16-byte length).
  1788.         */
  1789. -      skb = dev_alloc_skb(pkt_len);
  1790. +      skb = dev_alloc_skb( pkt_len );
  1791.        if ( skb == NULL )
  1792.          {
  1793.  #ifdef HP100_DEBUG
  1794. @@ -613,11 +756,22 @@
  1795.          }
  1796.         else
  1797.          {
  1798. +          u_char *ptr;
  1799. +        
  1800.            skb -> dev = dev;
  1801. -          insl( ioaddr + HP100_REG_DATA32, skb_put(skb, pkt_len), ( pkt_len + 3 ) >> 2 );
  1802. -          skb->protocol=eth_type_trans(skb,dev);
  1803. +          ptr = (u_char *)skb_put( skb, pkt_len );
  1804. +          if ( lp -> mem_mapped )
  1805. +            memcpy_fromio( ptr, lp -> mem_ptr, ( pkt_len + 3 ) & ~3 );
  1806. +           else
  1807. +            insl( ioaddr + HP100_REG_DATA32, ptr, ( pkt_len + 3 ) >> 2 );
  1808. +          skb -> protocol = eth_type_trans( skb, dev );
  1809.            netif_rx( skb );
  1810.            lp -> stats.rx_packets++;
  1811. +#ifdef HP100_DEBUG_RX
  1812. +          printk( "rx: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
  1813. +        ptr[ 0 ], ptr[ 1 ], ptr[ 2 ], ptr[ 3 ], ptr[ 4 ], ptr[ 5 ],
  1814. +        ptr[ 6 ], ptr[ 7 ], ptr[ 8 ], ptr[ 9 ], ptr[ 10 ], ptr[ 11 ] );
  1815. +#endif
  1816.          }
  1817.        hp100_outw( HP100_ADV_NXT_PKT | HP100_SET_LB, OPTION_MSW );
  1818.        switch ( header & 0x00070000 ) {
  1819. @@ -664,6 +818,17 @@
  1820.    hp100_page( PERFORMANCE );
  1821.  }
  1822.  
  1823. +static void hp100_clear_stats( int ioaddr )
  1824. +{
  1825. +  cli();
  1826. +  hp100_page( MAC_CTRL );        /* get all statistics bytes */
  1827. +  hp100_inw( DROPPED );
  1828. +  hp100_inb( CRC );
  1829. +  hp100_inb( ABORT );
  1830. +  hp100_page( PERFORMANCE );
  1831. +  sti();
  1832. +}
  1833. +
  1834.  /*
  1835.   *  multicast setup
  1836.   */
  1837. @@ -687,8 +852,8 @@
  1838.  #ifdef HP100_DEBUG_MULTI
  1839.    printk( "hp100_set_multicast_list: num_addrs = %d\n", num_addrs );
  1840.  #endif
  1841. -  hp100_ints_off();
  1842.    cli();
  1843. +  hp100_ints_off();
  1844.    hp100_page( MAC_CTRL );
  1845.    hp100_andb( ~(HP100_RX_EN | HP100_TX_EN), MAC_CFG_1 );    /* stop rx/tx */
  1846.  
  1847. @@ -711,13 +876,12 @@
  1848.  
  1849.    hp100_outb( lp -> mac2_mode, MAC_CFG_2 );
  1850.    hp100_andb( HP100_MAC1MODEMASK, MAC_CFG_1 );
  1851. -  hp100_orb( lp -> mac1_mode, MAC_CFG_1 );
  1852. -
  1853. -  hp100_orb( HP100_RX_EN | HP100_RX_IDLE, MAC_CFG_1 );        /* enable rx */
  1854. -  hp100_orb( HP100_TX_EN | HP100_TX_IDLE, MAC_CFG_1 );        /* enable tx */
  1855. +  hp100_orb( lp -> mac1_mode |
  1856. +           HP100_RX_EN | HP100_RX_IDLE |        /* enable rx */
  1857. +           HP100_TX_EN | HP100_TX_IDLE, MAC_CFG_1 );    /* enable tx */
  1858.    hp100_page( PERFORMANCE );
  1859. -  sti();
  1860.    hp100_ints_on();
  1861. +  sti();
  1862.  }
  1863.  
  1864.  #endif /* HAVE_MULTICAST */
  1865. @@ -726,11 +890,7 @@
  1866.   *  hardware interrupt handling
  1867.   */
  1868.  
  1869. -#ifndef LINUX_1_1_52
  1870.  static void hp100_interrupt( int irq, struct pt_regs *regs )
  1871. -#else
  1872. -static void hp100_interrupt( int irq )
  1873. -#endif
  1874.  {
  1875.    struct device *dev = (struct device *)irq2dev_map[ irq ];
  1876.    struct hp100_private *lp;
  1877. @@ -779,17 +939,22 @@
  1878.    int ioaddr = dev -> base_addr;
  1879.    struct hp100_private *lp = (struct hp100_private *)dev -> priv;
  1880.  
  1881. -  hp100_unreset_card();
  1882.    cli();
  1883. +  hp100_unreset_card();
  1884.    hp100_page( MAC_CTRL );
  1885.    hp100_outb( lp -> mac2_mode, MAC_CFG_2 );
  1886.    hp100_andb( HP100_MAC1MODEMASK, MAC_CFG_1 );
  1887. -  hp100_orb( lp -> mac1_mode, MAC_CFG_1 );
  1888. -  hp100_orb( HP100_RX_EN | HP100_RX_IDLE, MAC_CFG_1 );
  1889. -  hp100_orb( HP100_TX_EN | HP100_TX_IDLE, MAC_CFG_1 );
  1890. +  hp100_orb( lp -> mac1_mode |
  1891. +             HP100_RX_EN | HP100_RX_IDLE |
  1892. +             HP100_TX_EN | HP100_TX_IDLE, MAC_CFG_1 );
  1893.    hp100_page( PERFORMANCE );
  1894.    hp100_outw( HP100_INT_EN | HP100_SET_LB, OPTION_LSW );
  1895.    hp100_outw( HP100_TRI_INT | HP100_RESET_HB, OPTION_LSW );
  1896. +  if ( lp -> mem_mapped )
  1897. +    {
  1898. +      /* enable memory mapping */
  1899. +      hp100_outw( HP100_MMAP_DIS | HP100_RESET_HB, OPTION_LSW );
  1900. +    }
  1901.    sti();
  1902.  } 
  1903.  
  1904. @@ -799,7 +964,7 @@
  1905.    u_short val;
  1906.  
  1907.    hp100_outw( HP100_INT_EN | HP100_RESET_LB | 
  1908. -              HP100_TRI_INT | HP100_SET_HB, OPTION_LSW );
  1909. +              HP100_TRI_INT | HP100_MMAP_DIS | HP100_SET_HB, OPTION_LSW );
  1910.    val = hp100_inw( OPTION_LSW );
  1911.    hp100_page( HW_MAP );
  1912.    hp100_andb( HP100_BM_SLAVE, BM );
  1913. @@ -959,7 +1124,7 @@
  1914.  void cleanup_module( void )
  1915.  {
  1916.    unregister_netdev( &dev_hp100 );
  1917. -  release_region( dev_hp100.base_addr, 0x20 );
  1918. +  release_region( dev_hp100.base_addr, HP100_REGION_SIZE );
  1919.    kfree_s( dev_hp100.priv, sizeof( struct hp100_private ) );
  1920.    dev_hp100.priv = NULL;
  1921.  }
  1922. diff -u --recursive --new-file v1.3.14/linux/drivers/net/ibmtr.c linux/drivers/net/ibmtr.c
  1923. --- v1.3.14/linux/drivers/net/ibmtr.c    Mon Jul 31 15:59:01 1995
  1924. +++ linux/drivers/net/ibmtr.c    Wed Aug  2 09:13:50 1995
  1925. @@ -12,7 +12,7 @@
  1926.  */
  1927.  
  1928.  /*
  1929. -   Changes by Peter De Schrijver (stud11@cc4.kuleuven.ac.be) :
  1930. +   Changes by Peter De Schrijver (Peter.Deschrijver@linux.cc.kuleuven.ac.be) :
  1931.      
  1932.      + changed name to ibmtr.c in anticipation of other tr boards.
  1933.      + changed reset code and adapter open code.
  1934. @@ -37,7 +37,7 @@
  1935.  #define FALSE 0
  1936.  #define TRUE (!FALSE)
  1937.  
  1938. -static char *version = "ibmtr.c:v1.1.48 8/7/94 Peter De Schrijver and Mark Swanson\n"
  1939. +static const char *version = "ibmtr.c:v1.1.48 8/7/94 Peter De Schrijver and Mark Swanson\n"
  1940.                         "           modified 10/3/94 David W. Morris\n";
  1941.  
  1942.  static char pcchannelid[]={0x05, 0x00, 0x04, 0x09,
  1943. @@ -120,7 +120,7 @@
  1944.  /*  This routine combined with the #DEFINE DPRINTD serves
  1945.      to workaround the gcc apparent bug.   in tr_tx() */
  1946.  
  1947. -static void DummyCall(char * fmt,...) {DummyCallCount++;return;}
  1948. +static void DummyCall(const char * fmt,...) {DummyCallCount++;return;}
  1949.  
  1950.  static void PrtChanID(char *pcid, short stride) {
  1951.    short i, j;
  1952. diff -u --recursive --new-file v1.3.14/linux/drivers/net/lance.c linux/drivers/net/lance.c
  1953. --- v1.3.14/linux/drivers/net/lance.c    Tue Jul 11 10:02:49 1995
  1954. +++ linux/drivers/net/lance.c    Tue Aug  1 10:02:37 1995
  1955. @@ -15,7 +15,7 @@
  1956.         Code 930.5, Goddard Space Flight Center, Greenbelt MD 20771
  1957.  */
  1958.  
  1959. -static char *version = "lance.c:v1.08 4/10/95 dplatt@3do.com\n";
  1960. +static const char *version = "lance.c:v1.08 4/10/95 dplatt@3do.com\n";
  1961.  
  1962.  #include <linux/config.h>
  1963.  #include <linux/kernel.h>
  1964. @@ -194,7 +194,7 @@
  1965.      struct lance_rx_head rx_ring[RX_RING_SIZE];
  1966.      struct lance_tx_head tx_ring[TX_RING_SIZE];
  1967.      struct lance_init_block        init_block;
  1968. -    char *name;
  1969. +    const char *name;
  1970.      /* The saved address of a sent-in-place packet/buffer, for skfree(). */
  1971.      struct sk_buff* tx_skbuff[TX_RING_SIZE];
  1972.      long rx_buffs;                /* Address of Rx and Tx buffers. */
  1973. @@ -220,7 +220,7 @@
  1974.     reportedly has the same ID as the '965. */
  1975.  static struct lance_chip_type {
  1976.      int id_number;
  1977. -    char *name;
  1978. +    const char *name;
  1979.      int flags;
  1980.  } chip_table[] = {
  1981.      {0x0000, "LANCE 7990",                /* Ancient lance chip.  */
  1982. @@ -337,7 +337,7 @@
  1983.      struct lance_private *lp;
  1984.      short dma_channels;                    /* Mark spuriously-busy DMA channels */
  1985.      int i, reset_val, lance_version;
  1986. -    char *chipname;
  1987. +    const char *chipname;
  1988.      /* Flags for specific chips or boards. */
  1989.      unsigned char hpJ2405A = 0;                        /* HP ISA adaptor */
  1990.      int hp_builtin = 0;                    /* HP on-board ethernet. */
  1991. diff -u --recursive --new-file v1.3.14/linux/drivers/net/ne.c linux/drivers/net/ne.c
  1992. --- v1.3.14/linux/drivers/net/ne.c    Fri Jul  7 08:54:47 1995
  1993. +++ linux/drivers/net/ne.c    Tue Aug  1 10:02:37 1995
  1994. @@ -26,7 +26,7 @@
  1995.  
  1996.  /* Routines for the NatSemi-based designs (NE[12]000). */
  1997.  
  1998. -static char *version =
  1999. +static const char *version =
  2000.      "ne.c:v1.10 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
  2001.  
  2002.  #include <linux/kernel.h>
  2003. @@ -61,7 +61,7 @@
  2004.  
  2005.  #ifdef CONFIG_NE_BAD_CLONES
  2006.  /* A list of bad clones that we none-the-less recognize. */
  2007. -static struct { char *name8, *name16; unsigned char SAprefix[4];}
  2008. +static struct { const char *name8, *name16; unsigned char SAprefix[4];}
  2009.  bad_clone_list[] = {
  2010.      {"DE100", "DE200", {0x00, 0xDE, 0x01,}},
  2011.      {"DE120", "DE220", {0x00, 0x80, 0xc8,}},
  2012. @@ -148,7 +148,7 @@
  2013.      int i;
  2014.      unsigned char SA_prom[32];
  2015.      int wordlength = 2;
  2016. -    char *name = NULL;
  2017. +    const char *name = NULL;
  2018.      int start_page, stop_page;
  2019.      int neX000, ctron;
  2020.      int reg0 = inb_p(ioaddr);
  2021. diff -u --recursive --new-file v1.3.14/linux/drivers/net/pi2.c linux/drivers/net/pi2.c
  2022. --- v1.3.14/linux/drivers/net/pi2.c    Tue Jul 18 16:28:57 1995
  2023. +++ linux/drivers/net/pi2.c    Tue Aug  1 10:02:38 1995
  2024. @@ -82,7 +82,7 @@
  2025.  struct device *init_etherdev(struct device *dev, int sizeof_private,
  2026.                   unsigned long *mem_startp);
  2027.  
  2028. -static char *version =
  2029. +static const char *version =
  2030.  "PI: V0.8 ALPHA April 23 1995 David Perry (dp@hydra.carleton.ca)\n";
  2031.  
  2032.  /* The following #define is only really required for the PI card, not
  2033. diff -u --recursive --new-file v1.3.14/linux/drivers/net/plip.c linux/drivers/net/plip.c
  2034. --- v1.3.14/linux/drivers/net/plip.c    Fri Jun 30 16:22:28 1995
  2035. +++ linux/drivers/net/plip.c    Tue Aug  1 10:02:38 1995
  2036. @@ -32,7 +32,7 @@
  2037.   *     So, this PLIP can't communicate the PLIP of Linux v1.0.
  2038.   */
  2039.  
  2040. -static char *version = "NET3 PLIP version 2.0 gniibe@mri.co.jp\n";
  2041. +static const char *version = "NET3 PLIP version 2.0 gniibe@mri.co.jp\n";
  2042.  
  2043.  /*
  2044.    Sources:
  2045. diff -u --recursive --new-file v1.3.14/linux/drivers/net/ppp.c linux/drivers/net/ppp.c
  2046. --- v1.3.14/linux/drivers/net/ppp.c    Thu Jul 27 10:13:16 1995
  2047. +++ linux/drivers/net/ppp.c    Tue Aug  1 10:02:38 1995
  2048. @@ -136,11 +136,11 @@
  2049.  static void ppp_unlock(struct ppp *);
  2050.  static void ppp_add_fcs(struct ppp *);
  2051.  static int ppp_check_fcs(struct ppp *);
  2052. -static void ppp_print_buffer(const char *,char *,int,int);
  2053. +static void ppp_print_buffer(const char *,const char *,int,int);
  2054.  
  2055.  static int ppp_read(struct tty_struct *, struct file *, unsigned char *,
  2056.              unsigned int);
  2057. -static int ppp_write(struct tty_struct *, struct file *, unsigned char *,
  2058. +static int ppp_write(struct tty_struct *, struct file *, const unsigned char *,
  2059.               unsigned int);
  2060.  static int ppp_ioctl(struct tty_struct *, struct file *, unsigned int,
  2061.               unsigned long);
  2062. @@ -151,7 +151,7 @@
  2063.  
  2064.  #ifdef NEW_TTY_DRIVERS
  2065.  static int ppp_receive_room(struct tty_struct *tty);
  2066. -static void ppp_receive_buf(struct tty_struct *tty, unsigned char *cp,
  2067. +static void ppp_receive_buf(struct tty_struct *tty, const unsigned char *cp,
  2068.                  char *fp, int count);
  2069.  static void ppp_write_wakeup(struct tty_struct *tty);
  2070.  #else
  2071. @@ -918,7 +918,7 @@
  2072.  }
  2073.  
  2074.  
  2075. -static void ppp_receive_buf(struct tty_struct *tty, unsigned char *cp,
  2076. +static void ppp_receive_buf(struct tty_struct *tty, const unsigned char *cp,
  2077.                  char *fp, int count)
  2078.  {
  2079.    register struct ppp *ppp = ppp_find (tty);
  2080. @@ -1350,7 +1350,7 @@
  2081.  */
  2082.  
  2083.  static int
  2084. -ppp_write(struct tty_struct *tty, struct file *file, unsigned char *buf, unsigned int nr)
  2085. +ppp_write(struct tty_struct *tty, struct file *file, const unsigned char *buf, unsigned int nr)
  2086.  {
  2087.    struct ppp *ppp = ppp_find(tty);
  2088.    int i;
  2089. @@ -2021,7 +2021,7 @@
  2090.  
  2091.  static char hex[] = "0123456789ABCDEF";
  2092.  
  2093. -static inline void ppp_print_hex (register char *out, char *in, int count)
  2094. +static inline void ppp_print_hex (register char *out, const char *in, int count)
  2095.  {
  2096.    register unsigned char next_ch;
  2097.  
  2098. @@ -2035,7 +2035,7 @@
  2099.    }
  2100.  }
  2101.  
  2102. -static inline void ppp_print_char (register char *out, char *in, int count)
  2103. +static inline void ppp_print_char (register char *out, const char *in, int count)
  2104.  {
  2105.    register unsigned char next_ch;
  2106.  
  2107. @@ -2054,7 +2054,7 @@
  2108.    *out = '\0';
  2109.  }
  2110.  
  2111. -static void ppp_print_buffer(const char *name, char *buf, int count, int seg)
  2112. +static void ppp_print_buffer(const char *name, const char *buf, int count, int seg)
  2113.  {
  2114.    char line [44];
  2115.    int  old_fs = get_fs();
  2116. diff -u --recursive --new-file v1.3.14/linux/drivers/net/seeq8005.c linux/drivers/net/seeq8005.c
  2117. --- v1.3.14/linux/drivers/net/seeq8005.c    Tue Jul 11 10:02:49 1995
  2118. +++ linux/drivers/net/seeq8005.c    Tue Aug  1 10:02:38 1995
  2119. @@ -14,7 +14,7 @@
  2120.  
  2121.  */
  2122.  
  2123. -static char *version =
  2124. +static const char *version =
  2125.      "seeq8005.c:v1.00 8/07/95 Hamish Coleman (hamish@zot.apana.org.au)\n";
  2126.  
  2127.  /* Always include 'config.h' first in case the user wants to turn on
  2128. diff -u --recursive --new-file v1.3.14/linux/drivers/net/sk_g16.c linux/drivers/net/sk_g16.c
  2129. --- v1.3.14/linux/drivers/net/sk_g16.c    Fri Jul  7 08:54:48 1995
  2130. +++ linux/drivers/net/sk_g16.c    Tue Aug  1 10:02:38 1995
  2131. @@ -19,7 +19,7 @@
  2132.   *
  2133.  -*/
  2134.  
  2135. -static char *rcsid = "$Id: sk_g16.c,v 1.1 1994/06/30 16:25:15 root Exp $";
  2136. +static const char *rcsid = "$Id: sk_g16.c,v 1.1 1994/06/30 16:25:15 root Exp $";
  2137.  
  2138.  /*
  2139.   * The Schneider & Koch (SK) G16 Network device driver is based
  2140. diff -u --recursive --new-file v1.3.14/linux/drivers/net/slhc.c linux/drivers/net/slhc.c
  2141. --- v1.3.14/linux/drivers/net/slhc.c    Tue Jul 25 18:21:21 1995
  2142. +++ linux/drivers/net/slhc.c    Mon Jul 31 18:51:57 1995
  2143. @@ -42,6 +42,8 @@
  2144.   *                      Modularization.
  2145.   *    - Jan 1995    Bjorn Ekwall
  2146.   *            Use ip_fast_csum from ip.h
  2147. + *    - July 1995    Christos A. Polyzols 
  2148. + *            Spotted bug in tcp option checking
  2149.   *
  2150.   *
  2151.   *    This module is a difficult issue. It's clearly inet code but it's also clearly
  2152. @@ -355,7 +357,7 @@
  2153.       || ip->ttl != cs->cs_ip.ttl
  2154.       || th->doff != cs->cs_tcp.doff
  2155.       || (ip->ihl > 5 && memcmp(ip+1,cs->cs_ipopt,((ip->ihl)-5)*4) != 0)
  2156. -     || (th->doff > 5 && memcmp(th+1,cs->cs_tcpopt,((th->doff)-5)*4 != 0))){
  2157. +     || (th->doff > 5 && memcmp(th+1,cs->cs_tcpopt,((th->doff)-5)*4) != 0)){
  2158.          goto uncompressed;
  2159.      }
  2160.  
  2161. diff -u --recursive --new-file v1.3.14/linux/drivers/net/slip.c linux/drivers/net/slip.c
  2162. --- v1.3.14/linux/drivers/net/slip.c    Tue Jul 18 16:28:57 1995
  2163. +++ linux/drivers/net/slip.c    Tue Aug  1 10:02:38 1995
  2164. @@ -617,7 +617,7 @@
  2165.   * and sent on to some IP layer for further processing.
  2166.   */
  2167.  static void
  2168. -slip_receive_buf(struct tty_struct *tty, unsigned char *cp, char *fp, int count)
  2169. +slip_receive_buf(struct tty_struct *tty, const unsigned char *cp, char *fp, int count)
  2170.  {
  2171.      struct slip *sl = (struct slip *) tty->disc_data;
  2172.  
  2173. diff -u --recursive --new-file v1.3.14/linux/drivers/net/smc-ultra.c linux/drivers/net/smc-ultra.c
  2174. --- v1.3.14/linux/drivers/net/smc-ultra.c    Fri Jan 20 11:34:39 1995
  2175. +++ linux/drivers/net/smc-ultra.c    Tue Aug  1 10:02:38 1995
  2176. @@ -37,7 +37,7 @@
  2177.      use the non-8390-compatible "Altego" mode. (No support currently planned.)
  2178.  */
  2179.  
  2180. -static char *version =
  2181. +static const char *version =
  2182.      "smc-ultra.c:v1.12 1/18/95 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
  2183.  
  2184.  #include <linux/kernel.h>
  2185. @@ -111,7 +111,7 @@
  2186.  {
  2187.      int i;
  2188.      int checksum = 0;
  2189. -    char *model_name;
  2190. +    const char *model_name;
  2191.      unsigned char eeprom_irq = 0;
  2192.      /* Values from various config regs. */
  2193.      unsigned char num_pages, irqreg, addr;
  2194. diff -u --recursive --new-file v1.3.14/linux/drivers/net/wavelan.c linux/drivers/net/wavelan.c
  2195. --- v1.3.14/linux/drivers/net/wavelan.c    Mon Jul 31 15:59:01 1995
  2196. +++ linux/drivers/net/wavelan.c    Tue Aug  1 10:02:38 1995
  2197. @@ -72,7 +72,7 @@
  2198.  
  2199.  extern int        wavelan_probe(device *);    /* See Space.c */
  2200.  
  2201. -static char        *version    = "wavelan.c:v7 95/4/8\n";
  2202. +static const char    *version    = "wavelan.c:v7 95/4/8\n";
  2203.  
  2204.  /*
  2205.   * Entry point forward declarations.
  2206. @@ -494,7 +494,7 @@
  2207.   */
  2208.  static
  2209.  int
  2210. -wavelan_synchronous_cmd(device *dev, char *str)
  2211. +wavelan_synchronous_cmd(device *dev, const char *str)
  2212.  {
  2213.      unsigned short    ioaddr;
  2214.      net_local    *lp;
  2215. @@ -749,7 +749,7 @@
  2216.  #if    STRUCT_CHECK == 1
  2217.  
  2218.  static
  2219. -char    *
  2220. +const char    *
  2221.  wavelan_struct_check(void)
  2222.  {
  2223.  #define    SC(t,s,n)    if (sizeof(t) != s) return n
  2224. @@ -2447,7 +2447,7 @@
  2225.  {
  2226.      printk("dev:");
  2227.      printk(" start=%d,", dev->start);
  2228. -    printk(" tbusy=%d,", dev->tbusy);
  2229. +    printk(" tbusy=%ld,", dev->tbusy);
  2230.      printk(" interrupt=%d,", dev->interrupt);
  2231.      printk(" trans_start=%ld,", dev->trans_start);
  2232.      printk(" flags=0x%x,", dev->flags);
  2233. diff -u --recursive --new-file v1.3.14/linux/drivers/net/wd.c linux/drivers/net/wd.c
  2234. --- v1.3.14/linux/drivers/net/wd.c    Fri Apr 28 16:56:53 1995
  2235. +++ linux/drivers/net/wd.c    Tue Aug  1 10:02:38 1995
  2236. @@ -17,7 +17,7 @@
  2237.      Thanks to Russ Nelson (nelson@crnwyr.com) for loaning me a WD8013.
  2238.  */
  2239.  
  2240. -static char *version =
  2241. +static const char *version =
  2242.      "wd.c:v1.10 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
  2243.  
  2244.  #include <linux/kernel.h>
  2245. @@ -103,7 +103,7 @@
  2246.      int checksum = 0;
  2247.      int ancient = 0;            /* An old card without config registers. */
  2248.      int word16 = 0;                /* 0 = 8 bit, 1 = 16 bit */
  2249. -    char *model_name;
  2250. +    const char *model_name;
  2251.  
  2252.      for (i = 0; i < 8; i++)
  2253.          checksum += inb(ioaddr + 8 + i);
  2254. diff -u --recursive --new-file v1.3.14/linux/drivers/net/znet.c linux/drivers/net/znet.c
  2255. --- v1.3.14/linux/drivers/net/znet.c    Fri Jul  7 08:54:48 1995
  2256. +++ linux/drivers/net/znet.c    Tue Aug  1 10:02:38 1995
  2257. @@ -1,6 +1,6 @@
  2258.  /* znet.c: An Zenith Z-Note ethernet driver for linux. */
  2259.  
  2260. -static char *version = "znet.c:v1.02 9/23/94 becker@cesdis.gsfc.nasa.gov\n";
  2261. +static const char *version = "znet.c:v1.02 9/23/94 becker@cesdis.gsfc.nasa.gov\n";
  2262.  
  2263.  /*
  2264.      Written by Donald Becker.
  2265. diff -u --recursive --new-file v1.3.14/linux/drivers/pci/pci.c linux/drivers/pci/pci.c
  2266. --- v1.3.14/linux/drivers/pci/pci.c    Tue Jul 11 10:02:50 1995
  2267. +++ linux/drivers/pci/pci.c    Wed Aug  2 09:41:45 1995
  2268. @@ -135,7 +135,8 @@
  2269.      DEVICE( QLOGIC,        QLOGIC_ISP1020,    "ISP1020"),
  2270.      DEVICE( QLOGIC,        QLOGIC_ISP1022,    "ISP1022"),
  2271.      DEVICE( X,        X_AGX016,    "ITT AGX016"),
  2272. -    DEVICE( VORTEX,        VORTEX_GDT,    "GDT 6000b")
  2273. +    DEVICE( VORTEX,        VORTEX_GDT,    "GDT 6000b"),
  2274. +    DEVICE( HP,        HP_J2585A,    "J2585A")
  2275.  };
  2276.  
  2277.  
  2278. @@ -157,9 +158,9 @@
  2279.   * optimizations...
  2280.   */
  2281.  struct optimization_type {
  2282. -    char    *type;
  2283. -    char    *off;
  2284. -    char    *on;
  2285. +    const char    *type;
  2286. +    const char    *off;
  2287. +    const char    *on;
  2288.  } bridge_optimization[] = {
  2289.      {"Cache L2",            "write trough",    "write back"},
  2290.      {"CPU-PCI posted write",    "off",        "on"},
  2291. @@ -233,7 +234,7 @@
  2292.  }
  2293.  
  2294.  
  2295. -char *pci_strbioserr (int error)
  2296. +const char *pci_strbioserr (int error)
  2297.  {
  2298.      switch (error) {
  2299.            case PCIBIOS_SUCCESSFUL:        return "SUCCESSFUL";
  2300. @@ -337,6 +338,7 @@
  2301.            case PCI_VENDOR_ID_X:        return "X TECHNOLOGY";
  2302.            case PCI_VENDOR_ID_ACC:        return "ACC MICROELECTRONICS";
  2303.            case PCI_VENDOR_ID_VORTEX:    return "VORTEX";
  2304. +          case PCI_VENDOR_ID_HP:        return "Hewlett Packard";
  2305.            default:                return "Unknown vendor";
  2306.      }
  2307.  }
  2308. diff -u --recursive --new-file v1.3.14/linux/drivers/scsi/53c7,8xx.c linux/drivers/scsi/53c7,8xx.c
  2309. --- v1.3.14/linux/drivers/scsi/53c7,8xx.c    Thu Jun 29 19:02:42 1995
  2310. +++ linux/drivers/scsi/53c7,8xx.c    Tue Aug  1 10:02:39 1995
  2311. @@ -189,7 +189,7 @@
  2312.  static void intr_dma (struct Scsi_Host *host, struct NCR53c7x0_cmd *cmd);
  2313.  static void print_dsa (struct Scsi_Host *host, u32 *dsa);
  2314.  static int print_insn (struct Scsi_Host *host, u32 *insn,
  2315. -    char *prefix, int kernel);
  2316. +    const char *prefix, int kernel);
  2317.  
  2318.  static void NCR53c8xx_dsa_fixup (struct NCR53c7x0_cmd *cmd);
  2319.  static void NCR53c8x0_init_fixup (struct Scsi_Host *host);
  2320. @@ -3344,7 +3344,7 @@
  2321.      unsigned char dcmd, sbcl;
  2322.      struct NCR53c7x0_hostdata *hostdata = (struct NCR53c7x0_hostdata *)
  2323.          host->hostdata;
  2324. -    char *phase;
  2325. +    const char *phase;
  2326.      NCR53c7x0_local_setup(host);
  2327.  
  2328.      if (!cmd) {
  2329. @@ -3712,7 +3712,7 @@
  2330.   */
  2331.  
  2332.  static int print_insn (struct Scsi_Host *host, u32 *insn,
  2333. -    char *prefix, int kernel) {
  2334. +    const char *prefix, int kernel) {
  2335.      char buf[80],         /* Temporary buffer and pointer */
  2336.      *tmp;            
  2337.      unsigned char dcmd;        /* dcmd register for *insn */
  2338. diff -u --recursive --new-file v1.3.14/linux/drivers/scsi/NCR5380.c linux/drivers/scsi/NCR5380.c
  2339. --- v1.3.14/linux/drivers/scsi/NCR5380.c    Thu Jun 29 19:02:47 1995
  2340. +++ linux/drivers/scsi/NCR5380.c    Tue Aug  1 10:02:39 1995
  2341. @@ -320,7 +320,7 @@
  2342.  #ifdef NDEBUG
  2343.  static struct {
  2344.      unsigned char mask;
  2345. -    char * name;} 
  2346. +    const char * name;} 
  2347.  signals[] = {{ SR_DBP, "PARITY"}, { SR_RST, "RST" }, { SR_BSY, "BSY" }, 
  2348.      { SR_REQ, "REQ" }, { SR_MSG, "MSG" }, { SR_CD,  "CD" }, { SR_IO, "IO" }, 
  2349.      { SR_SEL, "SEL" }, {0, NULL}}, 
  2350. @@ -371,7 +371,7 @@
  2351.  
  2352.  static struct {
  2353.      unsigned char value;
  2354. -    char *name;
  2355. +    const char *name;
  2356.  } phases[] = {
  2357.  {PHASE_DATAOUT, "DATAOUT"}, {PHASE_DATAIN, "DATAIN"}, {PHASE_CMDOUT, "CMDOUT"},
  2358.  {PHASE_STATIN, "STATIN"}, {PHASE_MSGOUT, "MSGOUT"}, {PHASE_MSGIN, "MSGIN"},
  2359. diff -u --recursive --new-file v1.3.14/linux/drivers/scsi/aha152x.c linux/drivers/scsi/aha152x.c
  2360. --- v1.3.14/linux/drivers/scsi/aha152x.c    Thu Jun 29 19:02:47 1995
  2361. +++ linux/drivers/scsi/aha152x.c    Tue Aug  1 10:02:39 1995
  2362. @@ -338,7 +338,7 @@
  2363.  void aha152x_setup( char *str, int *ints );
  2364.  
  2365.  static void aha152x_reset_ports(void);
  2366. -static void aha152x_panic(char *msg);
  2367. +static void aha152x_panic(const char *msg);
  2368.  
  2369.  static void disp_ports(void);
  2370.  static void show_command(Scsi_Cmnd *ptr);
  2371. @@ -2274,7 +2274,7 @@
  2372.  /* 
  2373.   * Dump the current driver status and panic...
  2374.   */
  2375. -static void aha152x_panic(char *msg)
  2376. +static void aha152x_panic(const char *msg)
  2377.  {
  2378.    printk("\naha152x_panic: %s\n", msg);
  2379.    show_queues();
  2380. diff -u --recursive --new-file v1.3.14/linux/drivers/scsi/aha1542.c linux/drivers/scsi/aha1542.c
  2381. --- v1.3.14/linux/drivers/scsi/aha1542.c    Fri Jul  7 08:54:49 1995
  2382. +++ linux/drivers/scsi/aha1542.c    Tue Aug  1 10:02:39 1995
  2383. @@ -713,7 +713,7 @@
  2384.      aha1542_intr_reset(bse);
  2385.  }
  2386.  
  2387. -static int aha1542_getconfig(int base_io, unsigned char * irq_level, unsigned char * dma_chan)
  2388. +static int aha1542_getconfig(int base_io, unsigned char * irq_level, unsigned char * dma_chan, unsigned char * scsi_id)
  2389.  {
  2390.    unchar inquiry_cmd[] = {CMD_RETCONF };
  2391.    unchar inquiry_result[3];
  2392. @@ -775,6 +775,7 @@
  2393.      printk("Unable to determine Adaptec IRQ level.  Disabling board\n");
  2394.      return -1;
  2395.    };
  2396. +  *scsi_id=inquiry_result[2] & 7;
  2397.    return 0;
  2398.  }
  2399.  
  2400. @@ -855,7 +856,7 @@
  2401.  /* called from init/main.c */
  2402.  void aha1542_setup( char *str, int *ints)
  2403.  {
  2404. -    char *ahausage = "aha1542: usage: aha1542=<PORTBASE>[,<BUSON>,<BUSOFF>[,<DMASPEED>]]\n";
  2405. +    const char *ahausage = "aha1542: usage: aha1542=<PORTBASE>[,<BUSON>,<BUSOFF>[,<DMASPEED>]]\n";
  2406.      static int setup_idx = 0;
  2407.      int setup_portbase;
  2408.  
  2409. @@ -918,6 +919,7 @@
  2410.  {
  2411.      unsigned char dma_chan;
  2412.      unsigned char irq_level;
  2413. +    unsigned char scsi_id;
  2414.      unsigned long flags;
  2415.      unsigned int base_io;
  2416.      int trans;
  2417. @@ -977,9 +979,9 @@
  2418.          }
  2419.              if(aha1542_query(base_io, &trans))  goto unregister;
  2420.              
  2421. -            if (aha1542_getconfig(base_io, &irq_level, &dma_chan) == -1)  goto unregister;
  2422. +            if (aha1542_getconfig(base_io, &irq_level, &dma_chan, &scsi_id) == -1)  goto unregister;
  2423.              
  2424. -            printk("Configuring Adaptec at IO:%x, IRQ %d",base_io, irq_level);
  2425. +            printk("Configuring Adaptec (SCSI-ID %d) at IO:%x, IRQ %d", scsi_id, base_io, irq_level);
  2426.              if (dma_chan != 0xFF)
  2427.                  printk(", DMA priority %d", dma_chan);
  2428.              printk("\n");
  2429. diff -u --recursive --new-file v1.3.14/linux/drivers/scsi/aic7xxx.c linux/drivers/scsi/aic7xxx.c
  2430. --- v1.3.14/linux/drivers/scsi/aic7xxx.c    Tue Jul 25 18:21:22 1995
  2431. +++ linux/drivers/scsi/aic7xxx.c    Wed Aug  2 08:50:21 1995
  2432. @@ -41,7 +41,7 @@
  2433.   *
  2434.   *    -- Daniel M. Eischen, deischen@iworks.InterWorks.org, 04/03/95
  2435.   *
  2436. - *  $Id: aic7xxx.c,v 1.49 1995/06/28 05:41:09 deang Exp $
  2437. + *  $Id: aic7xxx.c,v 2.0 1995/08/02 05:28:42 deang Exp $
  2438.   *-M*************************************************************************/
  2439.  
  2440.  #ifdef MODULE
  2441. @@ -51,6 +51,7 @@
  2442.  #include <stdarg.h>
  2443.  #include <asm/io.h>
  2444.  #include <linux/string.h>
  2445. +#include <linux/errno.h>
  2446.  #include <linux/kernel.h>
  2447.  #include <linux/ioport.h>
  2448.  #include <linux/bios32.h>
  2449. @@ -64,10 +65,16 @@
  2450.  #include "hosts.h"
  2451.  #include "aic7xxx.h"
  2452.  
  2453. -#define AIC7XXX_C_VERSION  "$Revision: 1.49 $"
  2454. +#define AIC7XXX_C_VERSION  "$Revision: 2.0 $"
  2455.  
  2456.  #define NUMBER(arr)     (sizeof(arr) / sizeof(arr[0]))
  2457. -#define MIN(a,b) ((a < b) ? a : b)
  2458. +#define MIN(a,b)        ((a < b) ? a : b)
  2459. +#ifndef TRUE
  2460. +#  define TRUE 1
  2461. +#endif
  2462. +#ifndef FALSE
  2463. +#  define FALSE 0
  2464. +#endif
  2465.  
  2466.  /*
  2467.   * Defines for PCI bus support, testing twin bus support, DMAing of
  2468. @@ -395,13 +402,26 @@
  2469.  /*
  2470.   * Board Control (p. 3-43)
  2471.   */
  2472. -#define BCTL(x)        ((x) + 0xC84ul)
  2473. +#define BCTL(x)            ((x) + 0xC84ul)
  2474.  /*   RSVD            0xF0 */
  2475.  #define        ACE        0x08    /* Support for external processors */
  2476.  /*   RSVD            0x06 */
  2477.  #define        ENABLE        0x01
  2478.  
  2479. -#define BUSSPD(x)        ((x) + 0xC86ul)    /* FIFO threshold bits ? */
  2480. +/*
  2481. + * Bus On/Off Time (p. 3-44)
  2482. + */
  2483. +#define BUSTIME(x)        ((x) + 0xC85ul)
  2484. +#define        BOFF        0xF0
  2485. +#define        BON        0x0F
  2486. +
  2487. +/*
  2488. + * Bus Speed (p. 3-45)
  2489. + */
  2490. +#define    BUSSPD(x)        ((x) + 0xC86ul)
  2491. +#define        DFTHRSH        0xC0
  2492. +#define        STBOFF        0x38
  2493. +#define        STBON        0x07
  2494.  
  2495.  /*
  2496.   * Host Control (p. 3-47) R/W
  2497. @@ -719,13 +739,45 @@
  2498.   * to zero inside the kernel - we have to initialize them all
  2499.   * explicitly.
  2500.   *
  2501. - * We support a maximum of one adapter card per IRQ level (see the
  2502. - * rationale for this above). On an interrupt, use the IRQ as an
  2503. - * index into aic7xxx_boards[] to locate the card information.
  2504. + * We support multiple adapter cards per interrupt, but keep a
  2505. + * linked list of Scsi_Host structures for each IRQ.  On an interrupt,
  2506. + * use the IRQ as an index into aic7xxx_boards[] to locate the card
  2507. + * information.
  2508.   */
  2509.  static struct Scsi_Host *aic7xxx_boards[MAXIRQ + 1];
  2510.  
  2511.  /*
  2512. + * When we detect and register the card, it is possible to
  2513. + * have the card raise a spurious interrupt.  Because we need
  2514. + * to support multiple cards, we cannot tell which card caused
  2515. + * the spurious interrupt.  And, we might not even have added
  2516. + * the card info to the linked list at the time the spurious
  2517. + * interrupt gets raised.  This variable is suppose to keep track
  2518. + * of when we are registering a card and how many spurious
  2519. + * interrupts we have encountered.
  2520. + *
  2521. + *   0 - do not allow spurious interrupts.
  2522. + *   1 - allow 1 spurious interrupt
  2523. + *   2 - have 1 spurious interrupt, do not allow any more.
  2524. + *
  2525. + * I've made it an integer instead of a boolean in case we
  2526. + * want to allow more than one spurious interrupt for debugging
  2527. + * purposes.  Otherwise, it could just go from true to false to
  2528. + * true (or something like that).
  2529. + *
  2530. + * When the driver detects the cards, we'll set the count to 1
  2531. + * for each card detection and registration.  After the registration
  2532. + * of a card completes, we'll set the count back to 0.  So far, it
  2533. + * seems to be enough to allow a spurious interrupt only during
  2534. + * card registration; if a spurious interrupt is going to occur,
  2535. + * this is where it happens.
  2536. + *
  2537. + * We should be able to find a way to avoid getting the spurious
  2538. + * interrupt.  But until we do, we have to keep this ugly code.
  2539. + */
  2540. +static int aic7xxx_spurious_count;
  2541. +
  2542. +/*
  2543.   * The driver keeps up to four scb structures per card in memory. Only the
  2544.   * first 26 bytes of the structure are valid for the hardware, the rest used
  2545.   * for driver level bookeeping. The driver is further optimized
  2546. @@ -801,7 +853,7 @@
  2547.  
  2548.  static struct {
  2549.    unsigned char errno;
  2550. -  char *errmesg;
  2551. +  const char *errmesg;
  2552.  } hard_error[] = {
  2553.    { ILLHADDR,  "Illegal Host Access" },
  2554.    { ILLSADDR,  "Illegal Sequencer Address referrenced" },
  2555. @@ -872,7 +924,7 @@
  2556.  static struct {
  2557.    short period;
  2558.    short rate;
  2559. -  char *english;
  2560. +  const char *english;
  2561.  } aic7xxx_syncrates[] = {
  2562.    { 100,   0,  "10.0" },
  2563.    { 125,   1,  "8.0"  },
  2564. @@ -911,7 +963,7 @@
  2565.  
  2566.    static int DFT[] = { 0, 50, 75, 100 };
  2567.    static int SST[] = { 256, 128, 64, 32 };
  2568. -  static char *BUSW[] = { "", "-TWIN", "-WIDE" };
  2569. +  static const char *BUSW[] = { "", "-TWIN", "-WIDE" };
  2570.  
  2571.    host_conf = inb(HA_HOSTCONF(p->base));
  2572.    scsi_conf = inb(HA_SCSICONF(p->base));
  2573. @@ -925,14 +977,14 @@
  2574.     */
  2575.    if ((p->type == AIC_274x) || (p->type == AIC_284x))
  2576.    {
  2577. -    brelease = scsi_conf & 0x3F;
  2578.      dfthresh = host_conf >> 6;
  2579.    }
  2580.    else
  2581.    {
  2582. -    brelease = p->busrtime;
  2583.      dfthresh = scsi_conf >> 6;
  2584.    }
  2585. +
  2586. +  brelease = p->busrtime;
  2587.    if (brelease == 0)
  2588.    {
  2589.      brelease = 2;
  2590. @@ -1031,7 +1083,7 @@
  2591.    char *p;
  2592.  
  2593.    static struct {
  2594. -    char *name;
  2595. +    const char *name;
  2596.      int *flag;
  2597.    } options[] = {
  2598.      { "extended",    &aic7xxx_extended },
  2599. @@ -1124,7 +1176,7 @@
  2600.  {
  2601.    unsigned long i;
  2602.  
  2603. -  i = jiffies + (seconds * 100);  /* compute time to stop */
  2604. +  i = jiffies + (seconds * HZ);  /* compute time to stop */
  2605.  
  2606.    while (jiffies < i)
  2607.    {
  2608. @@ -1327,7 +1379,7 @@
  2609.      length = cmd->request_bufflen;
  2610.    }
  2611.  
  2612. -  return(length);
  2613. +  return (length);
  2614.  }
  2615.  
  2616.  /*+F*************************************************************************
  2617. @@ -1380,7 +1432,7 @@
  2618.    unsigned char active, ha_flags, transfer;
  2619.    unsigned char scsi_id, bus_width;
  2620.    unsigned char offset, rate, scratch;
  2621. -  unsigned char max_offset;
  2622. +  unsigned char max_offset, rej_byte;
  2623.    unsigned char head, tail;
  2624.    unsigned short target_mask;
  2625.    long flags;
  2626. @@ -1389,40 +1441,58 @@
  2627.    int target, tcl;
  2628.    int scbptr;
  2629.    Scsi_Cmnd *cmd;
  2630. -#if 0
  2631. -static int_count = 0;
  2632. -#endif
  2633.  
  2634.    p = (struct aic7xxx_host *) aic7xxx_boards[irq]->hostdata;
  2635. -#ifdef AIC7XXX_SHARE_IRQS
  2636. +
  2637.    /*
  2638. -   * Search for the host with a pending interrupt.
  2639. +   * Search for the host with a pending interrupt.  If we can't find
  2640. +   * one, then we've encountered a spurious interrupt.
  2641.     */
  2642.    while ((p != NULL) && !(inb(INTSTAT(p->base)) & INT_PEND))
  2643.    {
  2644. -    p = (struct aic7xxx_host *) p->next->hostdata;
  2645. +    if (p->next == NULL)
  2646. +    {
  2647. +      p = NULL;
  2648. +    }
  2649. +    else
  2650. +    {
  2651. +      p = (struct aic7xxx_host *) p->next->hostdata;
  2652. +    }
  2653.    }
  2654. +
  2655.    if (p == NULL)
  2656.    {
  2657. -    printk("aic7xxx_isr: Encountered spurious interrupt.\n");
  2658. -    return;
  2659. -  }
  2660. -#endif
  2661. -  base = p->base;
  2662. -  if (p->isr_count == 0xffffffff)
  2663. -  {
  2664. -    p->isr_count = 0;
  2665. -  }
  2666. -  else
  2667. -  {
  2668. -    p->isr_count = p->isr_count + 1;
  2669. +    if (aic7xxx_spurious_count == 1)
  2670. +    {
  2671. +      aic7xxx_spurious_count = 2;
  2672. +      printk("aic7xxx_isr: Encountered spurious interrupt.\n");
  2673. +      return;
  2674. +    }
  2675. +    else
  2676. +    {
  2677. +      /*
  2678. +       * The best we can do is to set p back to head of list and process
  2679. +       * the erroneous interrupt - most likely a BRKADRINT.
  2680. +       */
  2681. +      p = (struct aic7xxx_host *) aic7xxx_boards[irq]->hostdata;
  2682. +    }
  2683.    }
  2684. +
  2685. +  p->isr_count++; /* Keep track of interrupts for /proc/scsi */
  2686. +
  2687.    if ((p->a_scanned == 0) && (p->isr_count == 1))
  2688.    {
  2689. -    /* Allow for one interrupt when the card is enabled. */
  2690. +    /*
  2691. +     * We must only have one card at this IRQ and it must have been
  2692. +     * added to the board data before the spurious interrupt occurred.
  2693. +     * It is sufficient that we check isr_count and not the spurious
  2694. +     * interrupt count.
  2695. +     */
  2696. +    printk("aic7xxx_isr: Encountered spurious interrupt.\n");
  2697.      return;
  2698.    }
  2699.  
  2700. +  base = p->base;
  2701.    /*
  2702.     * Handle all the interrupt sources - especially for SCSI
  2703.     * interrupts, we won't get a second chance at them.
  2704. @@ -1462,10 +1532,26 @@
  2705.      {
  2706.        case BAD_PHASE:
  2707.      panic("aic7xxx_isr: unknown scsi bus phase\n");
  2708. +    break;
  2709.  
  2710.        case SEND_REJECT:
  2711. -    debug("aic7xxx_isr warning: issuing message reject, 1st byte 0x%x\n",
  2712. -          inb(HA_REJBYTE(base)));
  2713. +        rej_byte = inb(HA_REJBYTE(base));
  2714. +        scsi_id = inb(SCSIID(base)) >> 0x04;
  2715. +        scbptr = inb(SCBPTR(base));
  2716. +        scb = &(p->scb_array[scbptr]);
  2717. +        if (rej_byte != 0x20)
  2718. +        {
  2719. +          debug("aic7xxx_isr warning: issuing message reject, 1st byte 0x%x\n",
  2720. +                rej_byte);
  2721. +        }
  2722. +        else
  2723. +        {
  2724. +          printk("aic7xxx_isr warning: Tagged message rejected for target %d,"
  2725. +                 " channel %c.\n",
  2726. +                 scsi_id, (inb(SBLKCTL(base)) & SELBUSB ? 'B': 'A'));
  2727. +          scb->cmd->device->tagged_supported = 0;
  2728. +          scb->cmd->device->tagged_queue = 0;
  2729. +        }
  2730.      break;
  2731.  
  2732.        case NO_IDENT:
  2733. @@ -1572,7 +1658,7 @@
  2734.          /*
  2735.           * Send our own SDTR in reply.
  2736.           */
  2737. -        printk("Sending SDTR!!\n");
  2738. +        printk("aic7xxx_isr: Sending SDTR!!\n");
  2739.          outb(SEND_SDTR, HA_RETURN_1(base));
  2740.        }
  2741.      }
  2742. @@ -1591,7 +1677,7 @@
  2743.      {
  2744.        scsi_id = scsi_id + 8;  /* B channel */
  2745.      }
  2746. -    printk("Received MSG_WDTR, scsi_id = %d, "
  2747. +    printk("aic7xxx_isr: Received MSG_WDTR, scsi_id = %d, "
  2748.             "needwdtr = 0x%x\n", scsi_id, p->needwdtr);
  2749.      scratch = inb(HA_TARG_SCRATCH(base) + scsi_id);
  2750.  
  2751. @@ -1620,7 +1706,7 @@
  2752.        /*
  2753.         * Send our own WDTR in reply.
  2754.         */
  2755. -      printk("Will send WDTR!!\n");
  2756. +      printk("aic7xxx_isr: Will send WDTR!!\n");
  2757.        switch (bus_width)
  2758.        {
  2759.          case BUS_8_BIT:
  2760. @@ -1769,13 +1855,13 @@
  2761.                 sizeof(scb->SCSI_cmd_pointer));
  2762.  #ifdef AIC7XXX_USE_SG
  2763.          scb->SG_segment_count = 1;
  2764. -        memcpy (scb->SG_list_pointer, &req_buf,
  2765. +        memcpy(scb->SG_list_pointer, &req_buf,
  2766.              sizeof(scb->SG_list_pointer));
  2767.  #else
  2768.          scb->SG_segment_count = 0;
  2769. -        memcpy (scb->data_pointer, &req_buf,
  2770. +        memcpy(scb->data_pointer, &req_buf,
  2771.              sizeof(scb->data_pointer));
  2772. -        memcpy (scb->data_count, &req_buflen, 3);
  2773. +        memcpy(scb->data_count, &req_buflen, 3);
  2774.  #endif
  2775.  
  2776.          outb(SCBAUTO, SCBCNT(base));
  2777. @@ -1935,7 +2021,7 @@
  2778.        scb->next = p->free_scb;      /* preserve next pointer */
  2779.        p->free_scb = scb;            /* add at head of list */
  2780.  
  2781. -      restore_flags (flags);
  2782. +      restore_flags(flags);
  2783.        cmd->result = (DID_RETRY_COMMAND << 16);
  2784.        cmd->scsi_done(cmd);
  2785.      }
  2786. @@ -1964,8 +2050,8 @@
  2787.         }
  2788.         else
  2789.         {
  2790. -         panic ("aic7xxx_isr: AWAITING_SCB for an SCB that does "
  2791. -            "not have a waiting message");
  2792. +         panic("aic7xxx_isr: AWAITING_SCB for an SCB that does "
  2793. +           "not have a waiting message");
  2794.         }
  2795.      }
  2796.      break;
  2797. @@ -2121,7 +2207,7 @@
  2798.      }
  2799.      else
  2800.      {
  2801. -      if (! (status & BUSFREE))
  2802. +      if (!(status & BUSFREE))
  2803.        {
  2804.           /*
  2805.            * We don't know what's going on. Turn off the
  2806. @@ -2268,14 +2354,14 @@
  2807.      {
  2808.        if (inb(base + 4) & 1)
  2809.        {
  2810. -    return(AIC7xxx[i].type);
  2811. +    return (AIC7xxx[i].type);
  2812.        }
  2813.  
  2814.        printk("aic7xxx disabled at slot %d, ignored\n", slot);
  2815.      }
  2816.    }
  2817.  
  2818. -  return(AIC_NONE);
  2819. +  return (AIC_NONE);
  2820.  }
  2821.  
  2822.  /*+F*************************************************************************
  2823. @@ -2362,7 +2448,7 @@
  2824.    }
  2825.    if ((inb(SEECTL(base)) & SEERDY) == 0)
  2826.    {
  2827. -    outb (0, SEECTL(base));
  2828. +    outb(0, SEECTL(base));
  2829.      return (0);
  2830.    }
  2831.  
  2832. @@ -2372,7 +2458,7 @@
  2833.     * but only the first 32 are used by Adaptec BIOS.  The loop
  2834.     * will range from 0 to 31.
  2835.     */
  2836. -  for (k = 0; k < (sizeof(*sc) / 2); k = k + 1)
  2837. +  for (k = 0; k < (sizeof(*sc) / 2); k++)
  2838.    {
  2839.      /* Send chip select for one clock cycle. */
  2840.      outb(SEEMS | SEECK | SEECS, SEECTL(base));
  2841. @@ -2382,7 +2468,7 @@
  2842.       * Now we're ready to send the read command followed by the
  2843.       * address of the 16-bit register we want to read.
  2844.       */
  2845. -    for (i = 0; i < seeprom_read.len; i = i + 1)
  2846. +    for (i = 0; i < seeprom_read.len; i++)
  2847.      {
  2848.        temp = SEEMS | SEECS | (seeprom_read.bits[i] << 1);
  2849.        outb(temp, SEECTL(base));
  2850. @@ -2392,7 +2478,7 @@
  2851.        CLOCK_PULSE(base);
  2852.      }
  2853.      /* Send the 6 bit address (MSB first, LSB last). */
  2854. -    for (i = 5; i >= 0; i = i - 1)
  2855. +    for (i = 5; i >= 0; i--)
  2856.      {
  2857.        temp = k;
  2858.        temp = (temp >> i) & 1;  /* Mask out all but lower bit. */
  2859. @@ -2410,7 +2496,7 @@
  2860.       * with bit 0 (LSB).  The initial 0 will be shifted off the
  2861.       * top of our word as we let the loop run from 0 to 16.
  2862.       */
  2863. -    for (i = 0; i <= 16; i = i + 1)
  2864. +    for (i = 0; i <= 16; i++)
  2865.      {
  2866.        temp = SEEMS | SEECS;
  2867.        outb(temp, SEECTL(base));
  2868. @@ -2443,22 +2529,22 @@
  2869.  
  2870.    if (checksum != sc->checksum)
  2871.    {
  2872. -    printk ("aic7xxx : SEEPROM checksum error, ignoring SEEPROM settings.\n");
  2873. +    printk("aic7xxx: SEEPROM checksum error, ignoring SEEPROM settings.\n");
  2874.      return (0);
  2875.    }
  2876.  
  2877.  #if 0
  2878. -  printk ("Computed checksum 0x%x, checksum read 0x%x\n", checksum, sc->checksum);
  2879. -  printk ("Serial EEPROM:");
  2880. -  for (k = 0; k < (sizeof(*sc) / 2); k = k + 1)
  2881. +  printk("Computed checksum 0x%x, checksum read 0x%x\n", checksum, sc->checksum);
  2882. +  printk("Serial EEPROM:");
  2883. +  for (k = 0; k < (sizeof(*sc) / 2); k++)
  2884.    {
  2885.      if (((k % 8) == 0) && (k != 0))
  2886.      {
  2887. -      printk ("\n              ");
  2888. +      printk("\n              ");
  2889.      }
  2890. -    printk (" 0x%x", seeprom[k]);
  2891. +    printk(" 0x%x", seeprom[k]);
  2892.    }
  2893. -  printk ("\n");
  2894. +  printk("\n");
  2895.  #endif
  2896.  
  2897.    /* Release access to the memory port and the serial EEPROM. */
  2898. @@ -2531,7 +2617,7 @@
  2899.        break;
  2900.    }
  2901.  
  2902. -  return(maxscb);
  2903. +  return (maxscb);
  2904.  }
  2905.  
  2906.  /*+F*************************************************************************
  2907. @@ -2545,13 +2631,13 @@
  2908.  aic7xxx_register(Scsi_Host_Template *template, aha_type type,
  2909.           int base, unsigned char irq)
  2910.  {
  2911. -  static char * board_name[] = {"", "274x", "284x", "7870", "7850", "7872"};
  2912. +  static const char * board_name[] = {"", "274x", "284x", "7870", "7850", "7872"};
  2913.    int i;
  2914.    unsigned char sblkctl;
  2915.    int max_targets;
  2916.    int found = 1;
  2917.    unsigned char target_settings;
  2918. -  unsigned char scsi_conf;
  2919. +  unsigned char scsi_conf, host_conf;
  2920.    int have_seeprom = 0;
  2921.    struct Scsi_Host *host;
  2922.    struct aic7xxx_host *p;
  2923. @@ -2574,7 +2660,7 @@
  2924.    switch (type)
  2925.    {
  2926.      case AIC_274x:
  2927. -#if 1
  2928. +#if 0
  2929.        printk("aha274x: aic7770 hcntrl=0x%x\n", inb(HCNTRL(config.base)));
  2930.  #endif
  2931.        /*
  2932. @@ -2622,7 +2708,12 @@
  2933.         * since there was some issue about reseting the board.
  2934.         */
  2935.        config.irq = inb(HA_INTDEF(config.base)) & 0x0F;
  2936. -      config.busrtime = inb(HA_SCSICONF(config.base)) & 0x3C;
  2937. +      host_conf = inb(HA_HOSTCONF(config.base));
  2938. +      config.busrtime = host_conf & 0x3C;
  2939. +      /* XXX Is this valid for motherboard based controllers? */
  2940. +      /* Setup the FIFO threshold and the bus off time */
  2941. +      outb(host_conf & DFTHRSH, BUSSPD(config.base));
  2942. +      outb((host_conf << 2) & BOFF, BUSTIME(config.base));
  2943.  
  2944.        /*
  2945.         * A reminder until this can be detected automatically.
  2946. @@ -2632,7 +2723,7 @@
  2947.        break;
  2948.  
  2949.      case AIC_284x:
  2950. -#if 1
  2951. +#if 0
  2952.        printk("aha284x: aic7770 hcntrl=0x%x\n", inb(HCNTRL(config.base)));
  2953.  #endif
  2954.        outb(CHIPRST, HCNTRL(config.base));
  2955. @@ -2640,6 +2731,12 @@
  2956.        config.pause = REQ_PAUSE; /* DWG would like to be like the rest */
  2957.        config.extended = aic7xxx_extended;
  2958.        config.irq = inb(HA_INTDEF(config.base)) & 0x0F;
  2959. +      host_conf = inb(HA_HOSTCONF(config.base));
  2960. +      config.busrtime = host_conf & 0x3C;
  2961. +      /* XXX Is this valid for motherboard based controllers? */
  2962. +      /* Setup the FIFO threshold and the bus off time */
  2963. +      outb(host_conf & DFTHRSH, BUSSPD(config.base));
  2964. +      outb((host_conf << 2) & BOFF, BUSTIME(config.base));
  2965.  
  2966.        /*
  2967.         * A reminder until this can be detected automatically.
  2968. @@ -2651,7 +2748,7 @@
  2969.      case AIC_7850:
  2970.      case AIC_7870:
  2971.      case AIC_7872:
  2972. -#if 1
  2973. +#if 0
  2974.        printk("aic%s hcntrl=0x%x\n", board_name[type], inb(HCNTRL(config.base)));
  2975.  #endif
  2976.  
  2977. @@ -2661,15 +2758,15 @@
  2978.        config.extended = aic7xxx_extended;
  2979.        config.scsi_id = 7;
  2980.  
  2981. -      printk ("aic78xx: Reading SEEPROM... ");
  2982. +      printk("aic78xx: Reading SEEPROM... ");
  2983.        have_seeprom = read_seeprom(base, &sc);
  2984. -      if (! have_seeprom)
  2985. +      if (!have_seeprom)
  2986.        {
  2987. -    printk ("Unable to read SEEPROM\n");
  2988. +    printk("aic78xx: unable to read SEEPROM\n");
  2989.        }
  2990.        else
  2991.        {
  2992. -    printk ("done\n");
  2993. +    printk("done\n");
  2994.      config.extended = (sc.bios_control & CFEXTEND) >> 7;
  2995.      config.scsi_id = (sc.brtime_id & CFSCSIID);
  2996.      config.parity = (sc.adapter_control & CFSPARITY) ?
  2997. @@ -2734,7 +2831,7 @@
  2998.      case 2:     /* Wide bus */
  2999.        config.scsi_id = inb(HA_SCSICONF(base) + 1) & 0x0F;
  3000.        config.bus_type = AIC_WIDE;
  3001. -      printk("aic7xxx : Enabling wide channel of %s-Wide\n",
  3002. +      printk("aic7xxx: Enabling wide channel of %s-Wide\n",
  3003.           board_name[config.type]);
  3004.        outb(WIDE_BUS, HA_FLAGS(base));
  3005.        break;
  3006. @@ -2744,12 +2841,12 @@
  3007.  #ifdef AIC7XXX_TWIN_SUPPORT
  3008.        config.scsi_id_b = inb(HA_SCSICONF(base) + 1) & 0x07;
  3009.        config.bus_type = AIC_TWIN;
  3010. -      printk("aic7xxx : Enabled channel B of %s-Twin\n",
  3011. +      printk("aic7xxx: Enabled channel B of %s-Twin\n",
  3012.           board_name[config.type]);
  3013.        outb(TWIN_BUS, HA_FLAGS(base));
  3014.  #else
  3015.        config.bus_type = AIC_SINGLE;
  3016. -      printk("aic7xxx : Channel B of %s-Twin will be ignored\n",
  3017. +      printk("aic7xxx: Channel B of %s-Twin will be ignored\n",
  3018.           board_name[config.type]);
  3019.        outb(0, HA_FLAGS(base));
  3020.  #endif
  3021. @@ -2759,7 +2856,7 @@
  3022.        printk("aic7xxx is an unsupported type 0x%x, please "
  3023.           "mail deang@ims.com\n", inb(SBLKCTL(base)));
  3024.        outb(0, HA_FLAGS(base));
  3025. -      return(0);
  3026. +      return (0);
  3027.    }
  3028.  
  3029.    /*
  3030. @@ -2784,7 +2881,7 @@
  3031.        && (config.irq < 9 || config.irq > 15))
  3032.    {
  3033.      printk("aic7xxx uses unsupported IRQ level, ignoring\n");
  3034. -    return(0);
  3035. +    return (0);
  3036.    }
  3037.  
  3038.    /*
  3039. @@ -2798,7 +2895,7 @@
  3040.     if (aic7xxx_boards[config.irq] != NULL)
  3041.     {
  3042.       printk("aic7xxx_register: Sharing of IRQs is not configured.\n");
  3043. -     return(0);
  3044. +     return (0);
  3045.     }
  3046.  #endif
  3047.  
  3048. @@ -2857,7 +2954,7 @@
  3049.    p = (struct aic7xxx_host *) host->hostdata;
  3050.  
  3051.    /* Initialize the scb array by setting the state to free. */
  3052. -  for (i = 0; i < AIC7XXX_MAXSCB; i = i + 1)
  3053. +  for (i = 0; i < AIC7XXX_MAXSCB; i++)
  3054.    {
  3055.      p->scb_array[i].state = SCB_FREE;
  3056.      p->scb_array[i].next = NULL;
  3057. @@ -2884,14 +2981,23 @@
  3058.    if (aic7xxx_boards[config.irq] == NULL)
  3059.    {
  3060.      /*
  3061. +     * Warning! This must be done before requesting the irq.  It is
  3062. +     * possible for some boards to raise an interrupt as soon as
  3063. +     * they are enabled.  So when we request the irq from the Linux
  3064. +     * kernel, an interrupt is triggered immediately.  Therefore, we
  3065. +     * must ensure the board data is correctly set before the request.
  3066. +     */
  3067. +    aic7xxx_boards[config.irq] = host;
  3068. +
  3069. +    /*
  3070.       * Register IRQ with the kernel.
  3071.       */
  3072.      if (request_irq(config.irq, aic7xxx_isr, SA_INTERRUPT, "aic7xxx"))
  3073.      {
  3074.        printk("aic7xxx couldn't register irq %d, ignoring\n", config.irq);
  3075. -      return(0);
  3076. +      aic7xxx_boards[config.irq] = NULL;
  3077. +      return (0);
  3078.      }
  3079. -    aic7xxx_boards[config.irq] = host;
  3080.    }
  3081.    else
  3082.    {
  3083. @@ -2966,7 +3072,7 @@
  3084.      max_targets = 16;
  3085.    }
  3086.  
  3087. -  for (i = 0; i < max_targets; i = i + 1)
  3088. +  for (i = 0; i < max_targets; i++)
  3089.    {
  3090.      if (have_seeprom)
  3091.      {
  3092. @@ -3007,14 +3113,16 @@
  3093.  
  3094.    p->needsdtr = p->needsdtr_copy;
  3095.    p->needwdtr = p->needwdtr_copy;
  3096. +#if 0
  3097.    printk("NeedSdtr = 0x%x, 0x%x\n", p->needsdtr_copy, p->needsdtr);
  3098.    printk("NeedWdtr = 0x%x, 0x%x\n", p->needwdtr_copy, p->needwdtr);
  3099. +#endif 0
  3100.  
  3101. -  /* 
  3102. +  /*
  3103.     * Clear the control byte for every SCB so that the sequencer
  3104.     * doesn't get confused and think that one of them is valid
  3105.     */
  3106. -  for (i = 0; i < config.maxscb; i = i + 1)
  3107. +  for (i = 0; i < config.maxscb; i++)
  3108.    {
  3109.      outb(i, SCBPTR(base));
  3110.      outb(0, SCBARRAY(base));
  3111. @@ -3052,6 +3160,21 @@
  3112.    if (!aic7xxx_no_reset)
  3113.    {
  3114.      printk("Resetting the SCSI bus...\n");
  3115. +    if (p->bus_type == AIC_TWIN)
  3116. +    {
  3117. +      /*
  3118. +       * Select channel B.
  3119. +       */
  3120. +      outb(2, SBLKCTL(base));
  3121. +      outb(SCSIRSTO, SCSISEQ(base));
  3122. +      udelay(1000);
  3123. +      outb(0, SCSISEQ(base));
  3124. +      /*
  3125. +       * Select channel A.
  3126. +       */
  3127. +      outb(0, SBLKCTL(base));
  3128. +    }
  3129. +
  3130.      outb(SCSIRSTO, SCSISEQ(base));
  3131.      udelay(1000);
  3132.      outb(0, SCSISEQ(base));
  3133. @@ -3064,7 +3187,7 @@
  3134.     * command is sent to us by the high-level SCSI code.
  3135.     */
  3136.    UNPAUSE_SEQUENCER(p);
  3137. -  return(found);
  3138. +  return (found);
  3139.  }
  3140.  
  3141.  /*+F*************************************************************************
  3142. @@ -3095,6 +3218,11 @@
  3143.    }
  3144.  
  3145.    /*
  3146. +   * Initialize the spurious count to 0.
  3147. +   */
  3148. +  aic7xxx_spurious_count = 0;
  3149. +
  3150. +  /*
  3151.     * EISA/VL-bus card signature probe.
  3152.     */
  3153.    for (slot = MINSLOT; slot <= MAXSLOT; slot++)
  3154. @@ -3113,8 +3241,13 @@
  3155.      type = aic7xxx_probe(slot, HID0(base));
  3156.      if (type != AIC_NONE)
  3157.      {
  3158. -      printk("aic7xxx: hcntrl=0x%x\n", inb(HCNTRL(base)));
  3159. +      /*
  3160. +       * We found a card, allow 1 spurious interrupt.
  3161. +       */
  3162. +      aic7xxx_spurious_count = 1;
  3163. +
  3164.  #if 0
  3165. +      printk("aic7xxx: hcntrl=0x%x\n", inb(HCNTRL(base)));
  3166.        outb(inb(HCNTRL(base)) | CHIPRST, HCNTRL(base));
  3167.        irq = inb(HA_INTDEF(base)) & 0x0F;
  3168.  #endif
  3169. @@ -3125,6 +3258,11 @@
  3170.         * it with the kernel without incident.
  3171.         */
  3172.        found += aic7xxx_register(template, type, base, irq);
  3173. +
  3174. +      /*
  3175. +       * Disallow spurious interrupts.
  3176. +       */
  3177. +      aic7xxx_spurious_count = 0;
  3178.      }
  3179.    }
  3180.  
  3181. @@ -3135,10 +3273,6 @@
  3182.  #define DEVSTATUS 0x41
  3183.  #define RAMPSM    0x02
  3184.  
  3185. -/* This should be defined in pci.h */
  3186. -#define PCI_DEVICE_ID_ADAPTEC_7850    0x5078
  3187. -#define PCI_DEVICE_ID_ADAPTEC_7872    0x7278
  3188. -
  3189.    /*
  3190.     * PCI-bus probe.
  3191.     */
  3192. @@ -3212,36 +3346,51 @@
  3193.       */
  3194.      base = io_port - 0xC01;
  3195.  
  3196. +    /*
  3197. +     * I don't think we need to bother with allowing
  3198. +     * spurious interrupts for the 787x/7850, but what
  3199. +     * the hey.
  3200. +     */
  3201. +    aic7xxx_spurious_count = 1;
  3202. +
  3203. +#if 0
  3204.      printk("aic7xxx: hcntrl=0x%x\n", inb(HCNTRL(base)));
  3205. +#endif
  3206.      outb(inb(HCNTRL(base)) | CHIPRST, HCNTRL(base));
  3207.  
  3208.      error = pcibios_read_config_byte(pci_bus, pci_device_fn,
  3209.                       DEVREVID, &devrevid);
  3210.      if (devrevid < 3)
  3211.      {
  3212. -      printk ("aic7xxx_detect: AIC-7870 Rev %c\n", rev_id[devrevid]);
  3213. +      printk("aic7xxx_detect: AIC-7870 Rev %c\n", rev_id[devrevid]);
  3214.      }
  3215.      error = pcibios_read_config_byte(pci_bus, pci_device_fn,
  3216.                       DEVCONFIG, &devconfig);
  3217.      error = pcibios_read_config_byte(pci_bus, pci_device_fn,
  3218.                       DEVSTATUS, &devstatus);
  3219. -    printk ("aic7xxx_detect: devconfig 0x%x, devstatus 0x%x\n",
  3220. -        devconfig, devstatus);
  3221. +    printk("aic7xxx_detect: devconfig 0x%x, devstatus 0x%x\n",
  3222. +           devconfig, devstatus);
  3223.      if (devstatus & RAMPSM)
  3224.      {
  3225. -      printk ("aic7xxx_detect: detected external SCB RAM, "
  3226. -          "mail deang@ims.com for test patch");
  3227. +      printk("aic7xxx_detect: detected external SCB RAM, "
  3228. +         "mail deang@ims.com for test patch");
  3229.      }
  3230.  
  3231.      found += aic7xxx_register(template, type, base, irq);
  3232. +
  3233. +    /*
  3234. +     * Disable spurious interrupts.
  3235. +     */
  3236. +    aic7xxx_spurious_count = 0;
  3237. +
  3238.      index += 1;
  3239.        }
  3240.      }
  3241.    }
  3242.  #endif CONFIG_PCI
  3243.  
  3244. -  template->name = (char *) aic7xxx_info(NULL);
  3245. -  return(found);
  3246. +  template->name = aic7xxx_info(NULL);
  3247. +  return (found);
  3248.  }
  3249.  
  3250.  
  3251. @@ -3270,8 +3419,8 @@
  3252.    {
  3253.      if (cmd->device->tagged_queue == 0)
  3254.      {
  3255. -      printk ("aic7xxx_buildscb: Enabling tagged queuing for target %d, "
  3256. -          "channel %d\n", cmd->target, cmd->channel);
  3257. +      printk("aic7xxx_buildscb: Enabling tagged queuing for target %d, "
  3258. +         "channel %d\n", cmd->target, cmd->channel);
  3259.        cmd->device->tagged_queue = 1;
  3260.        cmd->device->current_tag = 1;  /* enable tagging */
  3261.      }
  3262. @@ -3346,8 +3495,8 @@
  3263.    else
  3264.    {
  3265.  #if 0
  3266. -    debug ("aic7xxx_buildscb: Creating scatterlist, addr=0x%lx, length=%d.\n",
  3267. -       (unsigned long) cmd->request_buffer, cmd->request_bufflen);
  3268. +    debug("aic7xxx_buildscb: Creating scatterlist, addr=0x%lx, length=%d.\n",
  3269. +      (unsigned long) cmd->request_buffer, cmd->request_bufflen);
  3270.  #endif
  3271.  #ifdef AIC7XXX_USE_SG
  3272.      scb->SG_segment_count = 1;
  3273. @@ -3455,7 +3604,7 @@
  3274.        memset(scb, 0, sizeof(*scb));
  3275.  
  3276.        scb->position = p->numscb;
  3277. -      p->numscb = p->numscb + 1;
  3278. +      p->numscb++;
  3279.        scb->state = SCB_ACTIVE;
  3280.        scb->next_waiting = SCB_LIST_NULL;
  3281.        memcpy(scb->host_scb, &scb, sizeof(scb));
  3282. @@ -3526,11 +3675,11 @@
  3283.    aic7xxx_status(cmd) = 0;
  3284.  
  3285.    cmd->result = 0;
  3286. -  memset (&cmd->sense_buffer, 0, sizeof (cmd->sense_buffer));
  3287. +  memset(&cmd->sense_buffer, 0, sizeof(cmd->sense_buffer));
  3288.  
  3289.    UNPAUSE_SEQUENCER(p);
  3290.    restore_flags(flags);
  3291. -  return(0);
  3292. +  return (0);
  3293.  }
  3294.  
  3295.  /* return values from aic7xxx_kill */
  3296. @@ -3597,7 +3746,7 @@
  3297.      if (scbsave[i] == scb->position)
  3298.      {
  3299.        found = 1;
  3300. -      i = i - 1;
  3301. +      i--;
  3302.      }
  3303.    }
  3304.  
  3305. @@ -3722,7 +3871,7 @@
  3306.    p->free_scb = scb;              /* add at head of free list */
  3307.    cmd->result = cmd->result << 16;
  3308.    cmd->scsi_done(cmd);
  3309. -  return(status);
  3310. +  return (status);
  3311.  }
  3312.  
  3313.  /*+F*************************************************************************
  3314. @@ -3751,7 +3900,7 @@
  3315.    }
  3316.  
  3317.    restore_flags(flags);
  3318. -  return(rv);
  3319. +  return (rv);
  3320.  }
  3321.  
  3322.  /*+F*************************************************************************
  3323. @@ -3836,7 +3985,7 @@
  3324.    }
  3325.  
  3326.    restore_flags(flags);
  3327. -  return(SCSI_RESET_SUCCESS);
  3328. +  return (SCSI_RESET_SUCCESS);
  3329.  }
  3330.  
  3331.  /*+F*************************************************************************
  3332. @@ -3874,7 +4023,7 @@
  3333.    geom[1] = sectors;
  3334.    geom[2] = cylinders;
  3335.  
  3336. -  return(0);
  3337. +  return (0);
  3338.  }
  3339.  
  3340.  #ifdef MODULE
  3341. @@ -3884,3 +4033,21 @@
  3342.  #include "scsi_module.c"
  3343.  #endif
  3344.  
  3345. +/*
  3346. + * Overrides for Emacs so that we almost follow Linus's tabbing style.
  3347. + * Emacs will notice this stuff at the end of the file and automatically
  3348. + * adjust the settings for this buffer only.  This must remain at the end
  3349. + * of the file.
  3350. + * ---------------------------------------------------------------------------
  3351. + * Local variables:
  3352. + * c-indent-level: 2
  3353. + * c-brace-imaginary-offset: 0
  3354. + * c-brace-offset: -2
  3355. + * c-argdecl-indent: 2
  3356. + * c-label-offset: -2
  3357. + * c-continued-statement-offset: 2
  3358. + * c-continued-brace-offset: 0
  3359. + * indent-tabs-mode: nil
  3360. + * tab-width: 8
  3361. + * End:
  3362. + */
  3363. diff -u --recursive --new-file v1.3.14/linux/drivers/scsi/aic7xxx.h linux/drivers/scsi/aic7xxx.h
  3364. --- v1.3.14/linux/drivers/scsi/aic7xxx.h    Tue Jul 25 18:21:22 1995
  3365. +++ linux/drivers/scsi/aic7xxx.h    Wed Aug  2 08:48:07 1995
  3366. @@ -18,12 +18,12 @@
  3367.   * along with this program; see the file COPYING.  If not, write to
  3368.   * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  3369.   * 
  3370. - * $Id: aic7xxx.h,v 1.18 1995/06/22 04:17:56 deang Exp $
  3371. + * $Id: aic7xxx.h,v 2.0 1995/08/02 05:28:42 deang Exp $
  3372.   *-M*************************************************************************/
  3373.  #ifndef _aic7xxx_h
  3374.  #define _aic7xxx_h
  3375.  
  3376. -#define AIC7XXX_H_VERSION  "$Revision: 1.18 $"
  3377. +#define AIC7XXX_H_VERSION  "$Revision: 2.0 $"
  3378.  
  3379.  /*
  3380.   * Scsi_Host_Template (see hosts.h) for AIC-7770/AIC-7870 - some fields
  3381. diff -u --recursive --new-file v1.3.14/linux/drivers/scsi/aic7xxx.seq linux/drivers/scsi/aic7xxx.seq
  3382. --- v1.3.14/linux/drivers/scsi/aic7xxx.seq    Thu Jun 29 19:02:48 1995
  3383. +++ linux/drivers/scsi/aic7xxx.seq    Wed Aug  2 08:48:07 1995
  3384. @@ -3,45 +3,29 @@
  3385.  #
  3386.  # Copyright (c) 1994 John Aycock
  3387.  #   The University of Calgary Department of Computer Science.
  3388. -#   All rights reserved.
  3389.  #
  3390.  # Modifications/enhancements:
  3391.  #   Copyright (c) 1994, 1995 Justin Gibbs. All rights reserved.
  3392.  #
  3393. -# Redistribution and use in source and binary forms, with or without
  3394. -# modification, are permitted provided that the following conditions
  3395. -# are met:
  3396. -# 1. Redistributions of source code must retain the above copyright
  3397. -#    notice, this list of conditions, and the following disclaimer.
  3398. -# 2. Redistributions in binary form must reproduce the above copyright
  3399. -#    notice, this list of conditions and the following disclaimer in the
  3400. -#    documentation and/or other materials provided with the distribution.
  3401. -# 3. All advertising materials mentioning features or use of this software
  3402. -#    must display the following acknowledgement:
  3403. -#      This product includes software developed by the University of Calgary
  3404. -#      Department of Computer Science and its contributors.
  3405. -# 4. Neither the name of the University nor the names of its contributors
  3406. -#    may be used to endorse or promote products derived from this software
  3407. -#    without specific prior written permission.
  3408. +# This program is free software; you can redistribute it and/or modify
  3409. +# it under the terms of the GNU General Public License as published by
  3410. +# the Free Software Foundation; either version 2, or (at your option)
  3411. +# any later version.
  3412.  #
  3413. -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  3414. -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  3415. -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  3416. -# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  3417. -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  3418. -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  3419. -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  3420. -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  3421. -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  3422. -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  3423. -# SUCH DAMAGE.
  3424. +# This program is distributed in the hope that it will be useful,
  3425. +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  3426. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  3427. +# GNU General Public License for more details.
  3428. +#
  3429. +# You should have received a copy of the GNU General Public License
  3430. +# along with this program; see the file COPYING.  If not, write to
  3431. +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  3432.  # 
  3433.  # FreeBSD, Twin, Wide, 2 command per target support, tagged queuing and other 
  3434.  # optimizations provided by Justin T. Gibbs (gibbs@FreeBSD.org)
  3435. -#
  3436.  ##-M#########################################################################
  3437.  
  3438. -VERSION AIC7XXX_SEQ_VER "$Id: aic7xxx.seq,v 1.19 1995/06/05 06:11:41 deang Exp $"
  3439. +VERSION AIC7XXX_SEQ_VER "$Id: aic7xxx.seq,v 2.0 1995/08/02 05:28:42 deang Exp $"
  3440.  
  3441.  SCBMASK        = 0x1f
  3442.  
  3443. diff -u --recursive --new-file v1.3.14/linux/drivers/scsi/aic7xxx_asm.c linux/drivers/scsi/aic7xxx_asm.c
  3444. --- v1.3.14/linux/drivers/scsi/aic7xxx_asm.c    Tue Jul 25 18:21:22 1995
  3445. +++ linux/drivers/scsi/aic7xxx_asm.c    Wed Aug  2 08:48:07 1995
  3446. @@ -26,9 +26,8 @@
  3447.   *
  3448.   * A <label> is an <undef-sym> ending in a colon.  Spaces, tabs, and commas
  3449.   * are token separators.
  3450. - *
  3451.   *-M*************************************************************************/
  3452. -static char id[] = "$Id: aic7xxx_asm.c,v 1.8 1995/05/25 06:25:36 root Exp $";
  3453. +static char id[] = "$Id: aic7xxx_asm.c,v 2.0 1995/08/02 05:28:42 deang Exp $";
  3454.  #include <ctype.h>
  3455.  #include <stdio.h>
  3456.  #include <string.h>
  3457. @@ -56,7 +55,7 @@
  3458.  unsigned char M[MEMORY][4];
  3459.  
  3460.  void 
  3461. -error(char *s)
  3462. +error(const char *s)
  3463.  {
  3464.      fprintf(stderr, "%s: %s at line %d\n", filename, s, lineno);
  3465.      exit(EXIT_FAILURE);
  3466. @@ -262,7 +261,7 @@
  3467.  #define NA    -1        /* not applicable */
  3468.  
  3469.  struct {
  3470. -    char *name;
  3471. +    const char *name;
  3472.      int n;            /* number of operands, including opcode */
  3473.      unsigned int op;    /* immediate or L?|pos_from_0 */
  3474.      unsigned int dest;    /* NA, pos_from_0, or I|immediate */
  3475. @@ -329,7 +328,7 @@
  3476.  
  3477.      static struct {
  3478.          unsigned int what;
  3479. -        char *name;
  3480. +        const char *name;
  3481.          int value;
  3482.      } jmptab[] = {
  3483.          { LO,    "jmp",        8  },
  3484. diff -u --recursive --new-file v1.3.14/linux/drivers/scsi/constants.c linux/drivers/scsi/constants.c
  3485. --- v1.3.14/linux/drivers/scsi/constants.c    Fri Jul  7 08:54:50 1995
  3486. +++ linux/drivers/scsi/constants.c    Tue Aug  1 10:02:40 1995
  3487. @@ -154,13 +154,13 @@
  3488.  struct error_info{
  3489.      unsigned char code1, code2;
  3490.      unsigned short int devices;
  3491. -    char * text;
  3492. +    const char * text;
  3493.  };
  3494.  
  3495.  struct error_info2{
  3496.      unsigned char code1, code2_min, code2_max;
  3497.      unsigned short int devices;
  3498. -    char * text;
  3499. +    const char * text;
  3500.  };
  3501.  
  3502.  static struct error_info2 additional2[] =
  3503. @@ -367,7 +367,7 @@
  3504.  #endif
  3505.  
  3506.  #if (CONSTANTS & CONST_SENSE)
  3507. -static char *snstext[] = {
  3508. +static const char *snstext[] = {
  3509.      "None","Recovered Error","Not Ready","Medium Error","Hardware Error",
  3510.      "Illegal Request","Unit Attention","Data Protect","Blank Check",
  3511.      "Key=9","Copy Aborted","Aborted Command","End-Of-Medium",
  3512. @@ -376,12 +376,12 @@
  3513.  
  3514.  
  3515.  /* Print sense information */
  3516. -void print_sense(char * devclass, Scsi_Cmnd * SCpnt)
  3517. +void print_sense(const char * devclass, Scsi_Cmnd * SCpnt)
  3518.  {
  3519.      int i, s;
  3520.      int sense_class, valid, code;
  3521.      unsigned char * sense_buffer = SCpnt->sense_buffer;
  3522. -    char * error = NULL;
  3523. +    const char * error = NULL;
  3524.      int dev = SCpnt->request.dev;
  3525.      
  3526.      sense_class = (sense_buffer[0] >> 4) & 0x07;
  3527. diff -u --recursive --new-file v1.3.14/linux/drivers/scsi/constants.h linux/drivers/scsi/constants.h
  3528. --- v1.3.14/linux/drivers/scsi/constants.h    Sun Aug 21 15:52:01 1994
  3529. +++ linux/drivers/scsi/constants.h    Tue Aug  1 10:02:40 1995
  3530. @@ -2,7 +2,7 @@
  3531.  #define _CONSTANTS_H
  3532.  extern void print_command(unsigned char *);
  3533.  extern int print_msg(unsigned char *);
  3534. -extern void print_sense(char *,  Scsi_Cmnd *);
  3535. +/* extern void print_sense(const char *,  Scsi_Cmnd *); */
  3536.  extern void print_status(int);
  3537.  extern void print_Scsi_Cmnd (Scsi_Cmnd *);
  3538.  #endif /* def _CONSTANTS_H */
  3539. diff -u --recursive --new-file v1.3.14/linux/drivers/scsi/eata.c linux/drivers/scsi/eata.c
  3540. --- v1.3.14/linux/drivers/scsi/eata.c    Fri Jul  7 13:42:57 1995
  3541. +++ linux/drivers/scsi/eata.c    Tue Aug  1 10:02:40 1995
  3542. @@ -310,7 +310,7 @@
  3543.     };
  3544.  
  3545.  static struct Scsi_Host * sh[MAX_BOARDS + 1];
  3546. -static char* driver_name = "EATA";
  3547. +static const char* driver_name = "EATA";
  3548.  static unsigned int irqlist[MAX_IRQ], calls[MAX_IRQ];
  3549.  
  3550.  #define HD(board) ((struct hostdata *) &sh[board]->hostdata)
  3551. @@ -364,7 +364,7 @@
  3552.     unsigned char irq, dma_channel, subversion;
  3553.     unsigned char protocol_rev;
  3554.     struct eata_info info;
  3555. -   char *board_status;
  3556. +   const char *board_status;
  3557.  
  3558.     /* Allowed DMA channels for ISA (0 indicates reserved) */
  3559.     unsigned char dma_channel_table[4] = { 5, 6, 7, 0 };
  3560. diff -u --recursive --new-file v1.3.14/linux/drivers/scsi/eata_pio.c linux/drivers/scsi/eata_pio.c
  3561. --- v1.3.14/linux/drivers/scsi/eata_pio.c    Tue Jul 18 16:28:58 1995
  3562. +++ linux/drivers/scsi/eata_pio.c    Tue Aug  1 10:02:40 1995
  3563. @@ -76,7 +76,7 @@
  3564.  static ulong int_counter = 0;
  3565.  static ulong queue_counter = 0;
  3566.  
  3567. -void hprint(char *str)
  3568. +void hprint(const char *str)
  3569.  {
  3570.      char *hptr =(char *) 0x000b0000;
  3571.      char *hptr2=(char *) 0x000b00a0; 
  3572. diff -u --recursive --new-file v1.3.14/linux/drivers/scsi/fdomain.c linux/drivers/scsi/fdomain.c
  3573. --- v1.3.14/linux/drivers/scsi/fdomain.c    Fri Jul  7 08:54:50 1995
  3574. +++ linux/drivers/scsi/fdomain.c    Tue Aug  1 10:02:40 1995
  3575. @@ -368,7 +368,7 @@
  3576.  */
  3577.  
  3578.  struct signature {
  3579. -   char *signature;
  3580. +   const char *signature;
  3581.     int  sig_offset;
  3582.     int  sig_length;
  3583.     int  major_bios_version;
  3584. diff -u --recursive --new-file v1.3.14/linux/drivers/scsi/hosts.h linux/drivers/scsi/hosts.h
  3585. --- v1.3.14/linux/drivers/scsi/hosts.h    Fri Jun 30 16:22:29 1995
  3586. +++ linux/drivers/scsi/hosts.h    Tue Aug  1 10:02:40 1995
  3587. @@ -64,7 +64,7 @@
  3588.      int (*proc_info)(char *, char **, off_t, int, int, int);
  3589.      
  3590.      /* driver name that will appear in the /proc/scsi directory */
  3591. -    char *procname;
  3592. +    const char *procname;
  3593.      
  3594.      /* low_ino of the drivers /proc/scsi entry. Defined in proc_fs.h */
  3595.      unsigned short low_ino;
  3596. @@ -73,7 +73,7 @@
  3597.       * The name pointer is a pointer to the name of the SCSI
  3598.       * device detected.
  3599.       */
  3600. -    char *name;
  3601. +    const char *name;
  3602.      
  3603.      /*
  3604.       * The detect function shall return non zero on detection,
  3605. @@ -335,8 +335,8 @@
  3606.  struct Scsi_Device_Template
  3607.  {
  3608.      struct Scsi_Device_Template * next;
  3609. -    char * name;
  3610. -    char * tag;
  3611. +    const char * name;
  3612. +    const char * tag;
  3613.      int * usage_count;          /* Used for loadable modules */
  3614.      unsigned char scsi_type;
  3615.      unsigned char major;
  3616. diff -u --recursive --new-file v1.3.14/linux/drivers/scsi/scsi.c linux/drivers/scsi/scsi.c
  3617. --- v1.3.14/linux/drivers/scsi/scsi.c    Thu Jul 27 10:13:17 1995
  3618. +++ linux/drivers/scsi/scsi.c    Tue Aug  1 10:02:41 1995
  3619. @@ -175,9 +175,9 @@
  3620.  #define BLIST_SINGLELUN 0x10
  3621.  
  3622.  struct dev_info{
  3623. -    char * vendor;
  3624. -    char * model;
  3625. -    char * revision; /* Latest revision known to be bad.  Not used yet */
  3626. +    const char * vendor;
  3627. +    const char * model;
  3628. +    const char * revision; /* Latest revision known to be bad.  Not used yet */
  3629.      unsigned flags;
  3630.  };
  3631.  
  3632. @@ -1267,7 +1267,7 @@
  3633.       * the completion function for the high level driver.
  3634.       */
  3635.      
  3636. -    memcpy ((void *) SCpnt->data_cmnd , (void *) cmnd, 12);
  3637. +    memcpy ((void *) SCpnt->data_cmnd , (const void *) cmnd, 12);
  3638.  #if 0
  3639.      SCpnt->host = host;
  3640.      SCpnt->channel = channel;
  3641. @@ -1282,7 +1282,7 @@
  3642.      SCpnt->done = done;
  3643.      SCpnt->timeout_per_command = timeout;
  3644.  
  3645. -    memcpy ((void *) SCpnt->cmnd , (void *) cmnd, 12);
  3646. +    memcpy ((void *) SCpnt->cmnd , (const void *) cmnd, 12);
  3647.      /* Zero the sense buffer.  Some host adapters automatically request
  3648.       * sense on error.  0 is not a valid sense code.  
  3649.       */
  3650. diff -u --recursive --new-file v1.3.14/linux/drivers/scsi/scsi.h linux/drivers/scsi/scsi.h
  3651. --- v1.3.14/linux/drivers/scsi/scsi.h    Thu Jul 27 10:13:17 1995
  3652. +++ linux/drivers/scsi/scsi.h    Tue Aug  1 10:02:41 1995
  3653. @@ -558,7 +558,7 @@
  3654.  extern int kernel_scsi_ioctl (Scsi_Device *dev, int cmd, void *arg);
  3655.  extern int      scsi_ioctl (Scsi_Device *dev, int cmd, void *arg);
  3656.  extern void print_command(unsigned char *);
  3657. -extern void print_sense(char *,     Scsi_Cmnd *);
  3658. +extern void print_sense(const char *,     Scsi_Cmnd *);
  3659.  
  3660.  
  3661.  #if defined(MAJOR_NR) && (MAJOR_NR != SCSI_TAPE_MAJOR)
  3662. diff -u --recursive --new-file v1.3.14/linux/drivers/scsi/seagate.c linux/drivers/scsi/seagate.c
  3663. --- v1.3.14/linux/drivers/scsi/seagate.c    Thu Jun 29 19:02:53 1995
  3664. +++ linux/drivers/scsi/seagate.c    Tue Aug  1 10:02:41 1995
  3665. @@ -95,7 +95,7 @@
  3666.                          in some command phase.
  3667.                      */
  3668.  
  3669. -static void *base_address = NULL;    /*
  3670. +static const void *base_address = NULL;    /*
  3671.                          Where the card ROM starts,
  3672.                          used to calculate memory mapped
  3673.                          register location.
  3674. @@ -153,7 +153,7 @@
  3675.  };
  3676.  
  3677.  typedef struct {
  3678. -    char *signature ;
  3679. +    const char *signature ;
  3680.      unsigned offset;
  3681.      unsigned length;
  3682.      unsigned char type;
  3683. @@ -327,10 +327,10 @@
  3684.  
  3685.      for (i = 0; i < (sizeof (seagate_bases) / sizeof (char  * )); ++i)
  3686.          for (j = 0; !base_address && j < NUM_SIGNATURES; ++j)
  3687. -        if (!memcmp ((void *) (seagate_bases[i] +
  3688. -            signatures[j].offset), (void *) signatures[j].signature,
  3689. +        if (!memcmp ((const void *) (seagate_bases[i] +
  3690. +            signatures[j].offset), (const void *) signatures[j].signature,
  3691.              signatures[j].length)) {
  3692. -            base_address = (void *) seagate_bases[i];
  3693. +            base_address = (const void *) seagate_bases[i];
  3694.              controller_type = signatures[j].type;
  3695.          }
  3696.  #endif /* OVERRIDE */
  3697. @@ -341,8 +341,8 @@
  3698.  
  3699.      if (base_address)
  3700.          {
  3701. -        st0x_cr_sr =(void *) (((unsigned char *) base_address) + (controller_type == SEAGATE ? 0x1a00 : 0x1c00)); 
  3702. -        st0x_dr = (void *) (((unsigned char *) base_address ) + (controller_type == SEAGATE ? 0x1c00 : 0x1e00));
  3703. +        st0x_cr_sr =(void *) (((const unsigned char *) base_address) + (controller_type == SEAGATE ? 0x1a00 : 0x1c00)); 
  3704. +        st0x_dr = (void *) (((const unsigned char *) base_address ) + (controller_type == SEAGATE ? 0x1c00 : 0x1e00));
  3705.  #ifdef DEBUG
  3706.          printk("%s detected. Base address = %x, cr = %x, dr = %x\n", tpnt->name, base_address, st0x_cr_sr, st0x_dr);
  3707.  #endif
  3708. @@ -1307,8 +1307,8 @@
  3709.              while (((status_read = STATUS) & STAT_BSY) && 
  3710.                     ((status_read & REQ_MASK) == REQ_CMDOUT))
  3711.                  if (status_read & STAT_REQ) {
  3712. -                    DATA = *(unsigned char *) cmnd;
  3713. -                    cmnd = 1+(unsigned char *) cmnd;
  3714. +                    DATA = *(const unsigned char *) cmnd;
  3715. +                    cmnd = 1+(const unsigned char *) cmnd;
  3716.  #ifdef SLOW_HANDSHAKE
  3717.                      if (borken) 
  3718.                          borken_wait();
  3719. diff -u --recursive --new-file v1.3.14/linux/drivers/scsi/sg.c linux/drivers/scsi/sg.c
  3720. --- v1.3.14/linux/drivers/scsi/sg.c    Tue Jul 25 18:21:22 1995
  3721. +++ linux/drivers/scsi/sg.c    Tue Aug  1 10:02:41 1995
  3722. @@ -289,7 +289,7 @@
  3723.  #define SG_SEND 0
  3724.  #define SG_REC  1
  3725.  
  3726. -static int sg_write(struct inode *inode,struct file *filp,char *buf,int count)
  3727. +static int sg_write(struct inode *inode,struct file *filp,const char *buf,int count)
  3728.  {
  3729.      int              bsize,size,amt,i;
  3730.      unsigned char      cmnd[MAX_COMMAND_SIZE];
  3731. @@ -298,7 +298,6 @@
  3732.      int              direction;
  3733.      unsigned char      opcode;
  3734.      Scsi_Cmnd        * SCpnt;
  3735. -    int              sgcnt;
  3736.      
  3737.      if ((i=verify_area(VERIFY_READ,buf,count)))
  3738.      return i;
  3739. diff -u --recursive --new-file v1.3.14/linux/drivers/scsi/sr.c linux/drivers/scsi/sr.c
  3740. --- v1.3.14/linux/drivers/scsi/sr.c    Tue Jul 11 10:02:51 1995
  3741. +++ linux/drivers/scsi/sr.c    Tue Aug  1 10:02:41 1995
  3742. @@ -1131,8 +1131,6 @@
  3743.  
  3744.  void cleanup_module( void) 
  3745.  {
  3746. -    int i;
  3747. -    
  3748.      if (MOD_IN_USE) {
  3749.      printk(KERN_INFO __FILE__ ": module is in use, remove rejected\n");
  3750.      return;
  3751. diff -u --recursive --new-file v1.3.14/linux/drivers/scsi/st.c linux/drivers/scsi/st.c
  3752. --- v1.3.14/linux/drivers/scsi/st.c    Tue Jul 11 10:02:51 1995
  3753. +++ linux/drivers/scsi/st.c    Tue Aug  1 10:02:41 1995
  3754. @@ -117,7 +117,7 @@
  3755.    int dev = SCpnt->request.dev;
  3756.    int result = SCpnt->result;
  3757.    unsigned char * sense = SCpnt->sense_buffer, scode;
  3758. -  char *stp;
  3759. +  const char *stp;
  3760.  
  3761.    if (!result /* && SCpnt->sense_buffer[0] == 0 */ )
  3762.      return 0;
  3763. @@ -753,14 +753,14 @@
  3764.  
  3765.  /* Write command */
  3766.      static int
  3767. -st_write(struct inode * inode, struct file * filp, char * buf, int count)
  3768. +st_write(struct inode * inode, struct file * filp, const char * buf, int count)
  3769.  {
  3770.      int dev;
  3771.      int total, do_count, blks, retval, transfer;
  3772.      int write_threshold;
  3773.      int doing_write = 0;
  3774.      static unsigned char cmd[10];
  3775. -    char *b_point;
  3776. +    const char *b_point;
  3777.      Scsi_Cmnd * SCpnt;
  3778.      Scsi_Tape * STp;
  3779.      unsigned int flags;
  3780. diff -u --recursive --new-file v1.3.14/linux/drivers/scsi/u14-34f.c linux/drivers/scsi/u14-34f.c
  3781. --- v1.3.14/linux/drivers/scsi/u14-34f.c    Thu Jun 29 19:02:54 1995
  3782. +++ linux/drivers/scsi/u14-34f.c    Tue Aug  1 10:02:41 1995
  3783. @@ -275,7 +275,7 @@
  3784.     };
  3785.  
  3786.  static struct Scsi_Host * sh[MAX_BOARDS + 1];
  3787. -static char* driver_name = "Ux4F";
  3788. +static const char* driver_name = "Ux4F";
  3789.  static unsigned int irqlist[MAX_IRQ], calls[MAX_IRQ];
  3790.  
  3791.  #define HD(board) ((struct hostdata *) &sh[board]->hostdata)
  3792. diff -u --recursive --new-file v1.3.14/linux/drivers/scsi/wd7000.c linux/drivers/scsi/wd7000.c
  3793. --- v1.3.14/linux/drivers/scsi/wd7000.c    Thu Jun 29 19:02:54 1995
  3794. +++ linux/drivers/scsi/wd7000.c    Tue Aug  1 10:02:41 1995
  3795. @@ -204,9 +204,9 @@
  3796.   *  added for the Future Domain version.
  3797.   */
  3798.  typedef struct signature {
  3799. -    void    *sig;           /* String to look for */
  3800. -    unsigned ofs;           /* offset from BIOS base address */
  3801. -    unsigned len;           /* length of string */
  3802. +    const void *sig;           /* String to look for */
  3803. +    unsigned    ofs;           /* offset from BIOS base address */
  3804. +    unsigned    len;           /* length of string */
  3805.  } Signature;
  3806.  
  3807.  static const Signature signatures[] = {
  3808. diff -u --recursive --new-file v1.3.14/linux/drivers/sound/pss.c linux/drivers/sound/pss.c
  3809. --- v1.3.14/linux/drivers/sound/pss.c    Tue Jul 11 10:02:54 1995
  3810. +++ linux/drivers/sound/pss.c    Wed Aug  2 09:36:37 1995
  3811. @@ -396,7 +396,7 @@
  3812.      }
  3813.  
  3814.  #ifdef EXCLUDE_MIDI
  3815. -  return 0
  3816. +  return 0;
  3817.  #else
  3818.    return probe_mpu401 (hw_config);
  3819.  #endif
  3820. diff -u --recursive --new-file v1.3.14/linux/fs/binfmt_elf.c linux/fs/binfmt_elf.c
  3821. --- v1.3.14/linux/fs/binfmt_elf.c    Tue Jul 11 10:02:55 1995
  3822. +++ linux/fs/binfmt_elf.c    Tue Aug  1 10:02:41 1995
  3823. @@ -780,7 +780,7 @@
  3824.   * These are the only things you should do on a core-file: use only these
  3825.   * functions to write out all the necessary info.
  3826.   */
  3827. -static int dump_write(struct file *file, void *addr, int nr)
  3828. +static int dump_write(struct file *file, const void *addr, int nr)
  3829.  {
  3830.      return file->f_op->write(file->f_inode, file, addr, nr) == nr;
  3831.  }
  3832. @@ -818,7 +818,7 @@
  3833.  /* An ELF note in memory */
  3834.  struct memelfnote
  3835.  {
  3836. -    char *name;
  3837. +    const char *name;
  3838.      int type;
  3839.      unsigned int datasz;
  3840.      void *data;
  3841. diff -u --recursive --new-file v1.3.14/linux/fs/block_dev.c linux/fs/block_dev.c
  3842. --- v1.3.14/linux/fs/block_dev.c    Tue Jun 27 14:11:38 1995
  3843. +++ linux/fs/block_dev.c    Tue Aug  1 10:05:54 1995
  3844. @@ -20,7 +20,7 @@
  3845.  #define MAX_BUF_PER_PAGE (PAGE_SIZE / 512)
  3846.  #define NBUF 64
  3847.  
  3848. -int block_write(struct inode * inode, struct file * filp, char * buf, int count)
  3849. +int block_write(struct inode * inode, struct file * filp, const char * buf, int count)
  3850.  {
  3851.      int blocksize, blocksize_bits, i, j, buffercount,write_error;
  3852.      int block, blocks;
  3853. @@ -197,6 +197,9 @@
  3854.  
  3855.      if (offset > size)
  3856.          left = 0;
  3857. +    /* size - offset might not fit into left, so check explicitly. */
  3858. +    else if (size - offset > INT_MAX)
  3859. +        left = INT_MAX;
  3860.      else
  3861.          left = size - offset;
  3862.      if (left > count)
  3863. diff -u --recursive --new-file v1.3.14/linux/fs/dcache.c linux/fs/dcache.c
  3864. --- v1.3.14/linux/fs/dcache.c    Wed Dec 28 10:43:49 1994
  3865. +++ linux/fs/dcache.c    Tue Aug  1 10:02:42 1995
  3866. @@ -104,7 +104,7 @@
  3867.   */
  3868.  static inline unsigned long namehash(const char * name, int len)
  3869.  {
  3870. -    return len * *(unsigned char *) name;
  3871. +    return len * *(const unsigned char *) name;
  3872.  }
  3873.  
  3874.  /*
  3875. diff -u --recursive --new-file v1.3.14/linux/fs/ext/file.c linux/fs/ext/file.c
  3876. --- v1.3.14/linux/fs/ext/file.c    Tue Jun 27 14:11:39 1995
  3877. +++ linux/fs/ext/file.c    Tue Aug  1 10:02:42 1995
  3878. @@ -32,7 +32,7 @@
  3879.  #include <linux/ext_fs.h>
  3880.  
  3881.  static int ext_file_read(struct inode *, struct file *, char *, int);
  3882. -static int ext_file_write(struct inode *, struct file *, char *, int);
  3883. +static int ext_file_write(struct inode *, struct file *, const char *, int);
  3884.  
  3885.  /*
  3886.   * We have mostly NULL's here: the current defaults are ok for
  3887. @@ -194,7 +194,7 @@
  3888.      return read;
  3889.  }
  3890.  
  3891. -static int ext_file_write(struct inode * inode, struct file * filp, char * buf, int count)
  3892. +static int ext_file_write(struct inode * inode, struct file * filp, const char * buf, int count)
  3893.  {
  3894.      off_t pos;
  3895.      int written,c;
  3896. diff -u --recursive --new-file v1.3.14/linux/fs/ext2/dir.c linux/fs/ext2/dir.c
  3897. --- v1.3.14/linux/fs/ext2/dir.c    Tue Jul 11 10:02:57 1995
  3898. +++ linux/fs/ext2/dir.c    Tue Aug  1 10:02:42 1995
  3899. @@ -69,11 +69,11 @@
  3900.      NULL            /* smap */
  3901.  };
  3902.  
  3903. -int ext2_check_dir_entry (char * function, struct inode * dir,
  3904. +int ext2_check_dir_entry (const char * function, struct inode * dir,
  3905.                struct ext2_dir_entry * de, struct buffer_head * bh,
  3906.                unsigned long offset)
  3907.  {
  3908. -    char * error_msg = NULL;
  3909. +    const char * error_msg = NULL;
  3910.  
  3911.      if (de->rec_len < EXT2_DIR_REC_LEN(1))
  3912.          error_msg = "rec_len is smaller than minimal";
  3913. diff -u --recursive --new-file v1.3.14/linux/fs/ext2/file.c linux/fs/ext2/file.c
  3914. --- v1.3.14/linux/fs/ext2/file.c    Tue Jul 11 10:02:57 1995
  3915. +++ linux/fs/ext2/file.c    Tue Aug  1 10:02:42 1995
  3916. @@ -35,7 +35,7 @@
  3917.  #include <linux/ext2_fs.h>
  3918.  
  3919.  static int ext2_file_read (struct inode *, struct file *, char *, int);
  3920. -static int ext2_file_write (struct inode *, struct file *, char *, int);
  3921. +static int ext2_file_write (struct inode *, struct file *, const char *, int);
  3922.  static void ext2_release_file (struct inode *, struct file *);
  3923.  
  3924.  /*
  3925. @@ -229,7 +229,7 @@
  3926.  }
  3927.  
  3928.  static int ext2_file_write (struct inode * inode, struct file * filp,
  3929. -                char * buf, int count)
  3930. +                const char * buf, int count)
  3931.  {
  3932.      const loff_t two_gb = 2147483647;
  3933.      loff_t pos;
  3934. diff -u --recursive --new-file v1.3.14/linux/fs/isofs/namei.c linux/fs/isofs/namei.c
  3935. --- v1.3.14/linux/fs/isofs/namei.c    Tue Jul 11 10:02:58 1995
  3936. +++ linux/fs/isofs/namei.c    Tue Aug  1 10:02:42 1995
  3937. @@ -28,7 +28,7 @@
  3938.   *
  3939.   * NOTE! unlike strncmp, isofs_match returns 1 for success, 0 for failure.
  3940.   */
  3941. -static int isofs_match(int len,const char * name, char * compare, int dlen)
  3942. +static int isofs_match(int len,const char * name, const char * compare, int dlen)
  3943.  {
  3944.      if (!compare)
  3945.          return 0;
  3946. diff -u --recursive --new-file v1.3.14/linux/fs/minix/file.c linux/fs/minix/file.c
  3947. --- v1.3.14/linux/fs/minix/file.c    Tue Jun 27 14:11:43 1995
  3948. +++ linux/fs/minix/file.c    Tue Aug  1 10:02:42 1995
  3949. @@ -30,7 +30,7 @@
  3950.  #include <linux/minix_fs.h>
  3951.  
  3952.  static int minix_file_read(struct inode *, struct file *, char *, int);
  3953. -static int minix_file_write(struct inode *, struct file *, char *, int);
  3954. +static int minix_file_write(struct inode *, struct file *, const char *, int);
  3955.  
  3956.  /*
  3957.   * We have mostly NULL's here: the current defaults are ok for
  3958. @@ -190,7 +190,7 @@
  3959.      return read;
  3960.  }
  3961.  
  3962. -static int minix_file_write(struct inode * inode, struct file * filp, char * buf, int count)
  3963. +static int minix_file_write(struct inode * inode, struct file * filp, const char * buf, int count)
  3964.  {
  3965.      off_t pos;
  3966.      int written,c;
  3967. diff -u --recursive --new-file v1.3.14/linux/fs/msdos/file.c linux/fs/msdos/file.c
  3968. --- v1.3.14/linux/fs/msdos/file.c    Tue Jun 27 14:11:43 1995
  3969. +++ linux/fs/msdos/file.c    Tue Aug  1 10:02:42 1995
  3970. @@ -267,13 +267,14 @@
  3971.  int msdos_file_write(
  3972.      struct inode *inode,
  3973.      struct file *filp,
  3974. -    char *buf,
  3975. +    const char *buf,
  3976.      int count)
  3977.  {
  3978.      struct super_block *sb = inode->i_sb;
  3979.      int sector,offset,size,left,written;
  3980.      int error,carry;
  3981. -    char *start,*to,ch;
  3982. +    const char *start;
  3983. +    char *to,ch;
  3984.      struct buffer_head *bh;
  3985.      int binary_mode = MSDOS_I(inode)->i_binary;
  3986.  
  3987. diff -u --recursive --new-file v1.3.14/linux/fs/msdos/misc.c linux/fs/msdos/misc.c
  3988. --- v1.3.14/linux/fs/msdos/misc.c    Wed Mar 22 10:31:42 1995
  3989. +++ linux/fs/msdos/misc.c    Tue Aug  1 10:02:43 1995
  3990. @@ -36,7 +36,7 @@
  3991.   * read-only. The file system can be made writable again by remounting it.
  3992.   */
  3993.  
  3994. -void fs_panic(struct super_block *s,char *msg)
  3995. +void fs_panic(struct super_block *s,const char *msg)
  3996.  {
  3997.      int not_ro;
  3998.  
  3999. @@ -365,7 +365,7 @@
  4000.          (*number)++; \
  4001.      }
  4002.  
  4003. -static int raw_scan_sector(struct super_block *sb,int sector,char *name,
  4004. +static int raw_scan_sector(struct super_block *sb,int sector,const char *name,
  4005.      int *number,int *ino,struct buffer_head **res_bh,
  4006.      struct msdos_dir_entry **res_de)
  4007.  {
  4008. @@ -406,7 +406,7 @@
  4009.   * requested entry is found or the end of the directory is reached.
  4010.   */
  4011.  
  4012. -static int raw_scan_root(struct super_block *sb,char *name,int *number,int *ino,
  4013. +static int raw_scan_root(struct super_block *sb,const char *name,int *number,int *ino,
  4014.      struct buffer_head **res_bh,struct msdos_dir_entry **res_de)
  4015.  {
  4016.      int count,cluster;
  4017. @@ -424,7 +424,7 @@
  4018.   * requested entry is found or the end of the directory is reached.
  4019.   */
  4020.  
  4021. -static int raw_scan_nonroot(struct super_block *sb,int start,char *name,
  4022. +static int raw_scan_nonroot(struct super_block *sb,int start,const char *name,
  4023.      int *number,int *ino,struct buffer_head **res_bh,struct msdos_dir_entry
  4024.      **res_de)
  4025.  {
  4026. @@ -460,7 +460,7 @@
  4027.   *       being created.
  4028.   */
  4029.  
  4030. -static int raw_scan(struct super_block *sb,int start,char *name,int *number,
  4031. +static int raw_scan(struct super_block *sb,int start,const char *name,int *number,
  4032.      int *ino,struct buffer_head **res_bh,struct msdos_dir_entry **res_de)
  4033.  {
  4034.      if (start)
  4035. @@ -532,7 +532,7 @@
  4036.   * for an empty directory slot (name is NULL). Returns an error code or zero.
  4037.   */
  4038.  
  4039. -int msdos_scan(struct inode *dir,char *name,struct buffer_head **res_bh,
  4040. +int msdos_scan(struct inode *dir,const char *name,struct buffer_head **res_bh,
  4041.      struct msdos_dir_entry **res_de,int *ino)
  4042.  {
  4043.      int res;
  4044. diff -u --recursive --new-file v1.3.14/linux/fs/msdos/namei.c linux/fs/msdos/namei.c
  4045. --- v1.3.14/linux/fs/msdos/namei.c    Mon Jan 23 10:38:29 1995
  4046. +++ linux/fs/msdos/namei.c    Tue Aug  1 10:02:43 1995
  4047. @@ -23,7 +23,7 @@
  4048.  
  4049.  /* MS-DOS "device special files" */
  4050.  
  4051. -static char *reserved_names[] = {
  4052. +static const char *reserved_names[] = {
  4053.      "CON     ","PRN     ","NUL     ","AUX     ",
  4054.      "LPT1    ","LPT2    ","LPT3    ","LPT4    ",
  4055.      "COM1    ","COM2    ","COM3    ","COM4    ",
  4056. @@ -41,7 +41,8 @@
  4057.  static int msdos_format_name(char conv,const char *name,int len,char *res,
  4058.    int dot_dirs)
  4059.  {
  4060. -    char *walk,**reserved;
  4061. +    char *walk;
  4062. +    const char **reserved;
  4063.      unsigned char c;
  4064.      int space;
  4065.  
  4066. @@ -177,7 +178,7 @@
  4067.  
  4068.  /* Creates a directory entry (name is already formatted). */
  4069.  
  4070. -static int msdos_create_entry(struct inode *dir,char *name,int is_dir,
  4071. +static int msdos_create_entry(struct inode *dir,const char *name,int is_dir,
  4072.      struct inode **result)
  4073.  {
  4074.      struct super_block *sb = dir->i_sb;
  4075. diff -u --recursive --new-file v1.3.14/linux/fs/nfs/dir.c linux/fs/nfs/dir.c
  4076. --- v1.3.14/linux/fs/nfs/dir.c    Fri Jun  9 13:03:02 1995
  4077. +++ linux/fs/nfs/dir.c    Wed Aug  2 09:51:31 1995
  4078. @@ -253,7 +253,7 @@
  4079.      entry->fhandle = *fhandle;
  4080.      entry->fattr = *fattr;
  4081.      entry->expiration_date = jiffies + (S_ISDIR(fattr->mode)
  4082. -        ? NFS_SERVER(dir)->acdirmax : NFS_SERVER(dir)->acregmax);
  4083. +        ? NFS_SERVER(dir)->acdirmin : NFS_SERVER(dir)->acregmin);
  4084.  }
  4085.  
  4086.  static void nfs_lookup_cache_remove(struct inode *dir, struct inode *inode,
  4087. diff -u --recursive --new-file v1.3.14/linux/fs/nfs/file.c linux/fs/nfs/file.c
  4088. --- v1.3.14/linux/fs/nfs/file.c    Mon Apr 17 13:41:26 1995
  4089. +++ linux/fs/nfs/file.c    Tue Aug  1 10:02:43 1995
  4090. @@ -31,7 +31,7 @@
  4091.  #include <linux/malloc.h>
  4092.  
  4093.  static int nfs_file_read(struct inode *, struct file *, char *, int);
  4094. -static int nfs_file_write(struct inode *, struct file *, char *, int);
  4095. +static int nfs_file_write(struct inode *, struct file *, const char *, int);
  4096.  static int nfs_fsync(struct inode *, struct file *);
  4097.  
  4098.  static struct file_operations nfs_file_operations = {
  4099. @@ -190,7 +190,7 @@
  4100.      return i + hunk;
  4101.  }
  4102.  
  4103. -static int nfs_file_write(struct inode *inode, struct file *file, char *buf,
  4104. +static int nfs_file_write(struct inode *inode, struct file *file, const char *buf,
  4105.                int count)
  4106.  {
  4107.      int result, hunk, i, n, pos;
  4108. diff -u --recursive --new-file v1.3.14/linux/fs/nfs/proc.c linux/fs/nfs/proc.c
  4109. --- v1.3.14/linux/fs/nfs/proc.c    Mon Jan 30 06:51:02 1995
  4110. +++ linux/fs/nfs/proc.c    Tue Aug  1 10:02:43 1995
  4111. @@ -144,7 +144,7 @@
  4112.  }
  4113.  
  4114.  
  4115. -static inline int *xdr_encode_data(int *p, char *data, int len)
  4116. +static inline int *xdr_encode_data(int *p, const char *data, int len)
  4117.  {
  4118.      int quadlen = QUADLEN(len);
  4119.      
  4120. @@ -423,7 +423,7 @@
  4121.  }
  4122.  
  4123.  int nfs_proc_write(struct nfs_server *server, struct nfs_fh *fhandle,
  4124. -           int offset, int count, char *data, struct nfs_fattr *fattr)
  4125. +           int offset, int count, const char *data, struct nfs_fattr *fattr)
  4126.  {
  4127.      int *p, *p0;
  4128.      int status;
  4129. diff -u --recursive --new-file v1.3.14/linux/fs/pipe.c linux/fs/pipe.c
  4130. --- v1.3.14/linux/fs/pipe.c    Tue Jun 27 14:11:43 1995
  4131. +++ linux/fs/pipe.c    Tue Aug  1 10:02:43 1995
  4132. @@ -69,7 +69,7 @@
  4133.      return 0;
  4134.  }
  4135.      
  4136. -static int pipe_write(struct inode * inode, struct file * filp, char * buf, int count)
  4137. +static int pipe_write(struct inode * inode, struct file * filp, const char * buf, int count)
  4138.  {
  4139.      int chars = 0, free = 0, written = 0;
  4140.      char *pipebuf;
  4141. @@ -121,7 +121,12 @@
  4142.      return -ESPIPE;
  4143.  }
  4144.  
  4145. -static int bad_pipe_rw(struct inode * inode, struct file * filp, char * buf, int count)
  4146. +static int bad_pipe_r(struct inode * inode, struct file * filp, char * buf, int count)
  4147. +{
  4148. +    return -EBADF;
  4149. +}
  4150. +
  4151. +static int bad_pipe_w(struct inode * inode, struct file * filp, const char * buf, int count)
  4152.  {
  4153.      return -EBADF;
  4154.  }
  4155. @@ -265,7 +270,7 @@
  4156.  struct file_operations connecting_fifo_fops = {
  4157.      pipe_lseek,
  4158.      connect_read,
  4159. -    bad_pipe_rw,
  4160. +    bad_pipe_w,
  4161.      NULL,        /* no readdir */
  4162.      connect_select,
  4163.      pipe_ioctl,
  4164. @@ -278,7 +283,7 @@
  4165.  struct file_operations read_fifo_fops = {
  4166.      pipe_lseek,
  4167.      pipe_read,
  4168. -    bad_pipe_rw,
  4169. +    bad_pipe_w,
  4170.      NULL,        /* no readdir */
  4171.      fifo_select,
  4172.      pipe_ioctl,
  4173. @@ -290,7 +295,7 @@
  4174.  
  4175.  struct file_operations write_fifo_fops = {
  4176.      pipe_lseek,
  4177. -    bad_pipe_rw,
  4178. +    bad_pipe_r,
  4179.      pipe_write,
  4180.      NULL,        /* no readdir */
  4181.      fifo_select,
  4182. @@ -317,7 +322,7 @@
  4183.  struct file_operations read_pipe_fops = {
  4184.      pipe_lseek,
  4185.      pipe_read,
  4186. -    bad_pipe_rw,
  4187. +    bad_pipe_w,
  4188.      NULL,        /* no readdir */
  4189.      pipe_select,
  4190.      pipe_ioctl,
  4191. @@ -329,7 +334,7 @@
  4192.  
  4193.  struct file_operations write_pipe_fops = {
  4194.      pipe_lseek,
  4195. -    bad_pipe_rw,
  4196. +    bad_pipe_r,
  4197.      pipe_write,
  4198.      NULL,        /* no readdir */
  4199.      pipe_select,
  4200. diff -u --recursive --new-file v1.3.14/linux/fs/proc/array.c linux/fs/proc/array.c
  4201. --- v1.3.14/linux/fs/proc/array.c    Tue Jun 27 14:11:43 1995
  4202. +++ linux/fs/proc/array.c    Tue Aug  1 10:02:43 1995
  4203. @@ -146,7 +146,7 @@
  4204.  }
  4205.  
  4206.  /* Writing to /proc/profile resets the counters */
  4207. -static int write_profile(struct inode * inode, struct file * file, char * buf, int count)
  4208. +static int write_profile(struct inode * inode, struct file * file, const char * buf, int count)
  4209.  {
  4210.      int i=prof_len;
  4211.  
  4212. diff -u --recursive --new-file v1.3.14/linux/fs/proc/inode.c linux/fs/proc/inode.c
  4213. --- v1.3.14/linux/fs/proc/inode.c    Thu Jul 27 10:13:17 1995
  4214. +++ linux/fs/proc/inode.c    Tue Aug  1 13:06:31 1995
  4215. @@ -230,10 +230,9 @@
  4216.          return;
  4217.      }
  4218.      ino &= 0x0000ffff;
  4219. -    if (ino == PROC_PID_INO ||
  4220. -        (p->dumpable && p->uid == p->euid && p->gid == p->egid)) {
  4221. -        inode->i_uid = p->uid;
  4222. -        inode->i_gid = p->gid;
  4223. +    if (ino == PROC_PID_INO || p->dumpable) {
  4224. +        inode->i_uid = p->euid;
  4225. +        inode->i_gid = p->egid;
  4226.      }
  4227.      switch (ino) {
  4228.          case PROC_PID_INO:
  4229. diff -u --recursive --new-file v1.3.14/linux/fs/proc/scsi.c linux/fs/proc/scsi.c
  4230. --- v1.3.14/linux/fs/proc/scsi.c    Tue Jul 11 10:02:58 1995
  4231. +++ linux/fs/proc/scsi.c    Tue Aug  1 10:02:43 1995
  4232. @@ -33,7 +33,7 @@
  4233.  static int proc_readscsi(struct inode * inode, struct file * file,
  4234.               char * buf, int count);
  4235.  static int proc_writescsi(struct inode * inode, struct file * file,
  4236. -             char * buf, int count);
  4237. +             const char * buf, int count);
  4238.  static int proc_readscsidir(struct inode *, struct file *, 
  4239.                  void *, filldir_t filldir);
  4240.  static int proc_lookupscsi(struct inode *,const char *,int,struct inode **);
  4241. @@ -282,7 +282,7 @@
  4242.  
  4243.  
  4244.  static int proc_writescsi(struct inode * inode, struct file * file,
  4245. -             char * buf, int count)
  4246. +             const char * buf, int count)
  4247.  {
  4248.      int ret = 0;
  4249.      char * page;
  4250. diff -u --recursive --new-file v1.3.14/linux/fs/smbfs/file.c linux/fs/smbfs/file.c
  4251. --- v1.3.14/linux/fs/smbfs/file.c    Tue Jul 11 10:02:58 1995
  4252. +++ linux/fs/smbfs/file.c    Tue Aug  1 10:02:43 1995
  4253. @@ -128,7 +128,7 @@
  4254.  }
  4255.  
  4256.  static int 
  4257. -smb_file_write(struct inode *inode, struct file *file, char *buf, int count)
  4258. +smb_file_write(struct inode *inode, struct file *file, const char *buf, int count)
  4259.  {
  4260.      int result, bufsize, to_write, already_written;
  4261.          off_t pos;
  4262. diff -u --recursive --new-file v1.3.14/linux/fs/smbfs/proc.c linux/fs/smbfs/proc.c
  4263. --- v1.3.14/linux/fs/smbfs/proc.c    Fri Jul  7 08:54:52 1995
  4264. +++ linux/fs/smbfs/proc.c    Tue Aug  1 10:02:43 1995
  4265. @@ -658,7 +658,7 @@
  4266.  
  4267.  int
  4268.  smb_proc_write(struct smb_server *server, struct smb_dirent *finfo,
  4269. -               off_t offset, int count, char *data)
  4270. +               off_t offset, int count, const char *data)
  4271.  {
  4272.          int res = 0;
  4273.          char *buf = server->packet;
  4274. @@ -1513,7 +1513,7 @@
  4275.  
  4276.  struct smb_prots {
  4277.      enum smb_protocol prot;
  4278. -    char *name;
  4279. +    const char *name;
  4280.  };
  4281.  
  4282.  /* smb_proc_reconnect: We expect the server to be locked, so that you
  4283. diff -u --recursive --new-file v1.3.14/linux/fs/super.c linux/fs/super.c
  4284. --- v1.3.14/linux/fs/super.c    Wed Jan 18 09:31:40 1995
  4285. +++ linux/fs/super.c    Tue Aug  1 10:02:43 1995
  4286. @@ -168,7 +168,7 @@
  4287.      return len;
  4288.  }
  4289.  
  4290. -struct file_system_type *get_fs_type(char *name)
  4291. +struct file_system_type *get_fs_type(const char *name)
  4292.  {
  4293.      struct file_system_type * fs = file_systems;
  4294.      
  4295. @@ -254,7 +254,7 @@
  4296.          sb->s_op->put_super(sb);
  4297.  }
  4298.  
  4299. -static struct super_block * read_super(dev_t dev,char *name,int flags,
  4300. +static struct super_block * read_super(dev_t dev,const char *name,int flags,
  4301.                         void *data, int silent)
  4302.  {
  4303.      struct super_block * s;
  4304. @@ -428,7 +428,7 @@
  4305.   * We also have to flush all inode-data for this device, as the new mount
  4306.   * might need new info.
  4307.   */
  4308. -static int do_mount(dev_t dev, const char * dir, char * type, int flags, void * data)
  4309. +static int do_mount(dev_t dev, const char * dir, const char * type, int flags, void * data)
  4310.  {
  4311.      struct inode * dir_i;
  4312.      struct super_block * sb;
  4313. @@ -554,7 +554,7 @@
  4314.      struct file_operations * fops;
  4315.      dev_t dev;
  4316.      int retval;
  4317. -    char * t;
  4318. +    const char * t;
  4319.      unsigned long flags = 0;
  4320.      unsigned long page = 0;
  4321.  
  4322. diff -u --recursive --new-file v1.3.14/linux/fs/sysv/file.c linux/fs/sysv/file.c
  4323. --- v1.3.14/linux/fs/sysv/file.c    Tue Jun 27 14:11:44 1995
  4324. +++ linux/fs/sysv/file.c    Tue Aug  1 10:02:43 1995
  4325. @@ -36,7 +36,7 @@
  4326.  #include <linux/fs.h>
  4327.  #include <linux/sysv_fs.h>
  4328.  
  4329. -static int sysv_file_write(struct inode *, struct file *, char *, int);
  4330. +static int sysv_file_write(struct inode *, struct file *, const char *, int);
  4331.  
  4332.  /*
  4333.   * We have mostly NULL's here: the current defaults are ok for
  4334. @@ -200,7 +200,7 @@
  4335.      return read;
  4336.  }
  4337.  
  4338. -static int sysv_file_write(struct inode * inode, struct file * filp, char * buf, int count)
  4339. +static int sysv_file_write(struct inode * inode, struct file * filp, const char * buf, int count)
  4340.  {
  4341.      struct super_block * sb = inode->i_sb;
  4342.      off_t pos;
  4343. diff -u --recursive --new-file v1.3.14/linux/fs/umsdos/emd.c linux/fs/umsdos/emd.c
  4344. --- v1.3.14/linux/fs/umsdos/emd.c    Fri Jul  7 08:54:52 1995
  4345. +++ linux/fs/umsdos/emd.c    Tue Aug  1 10:02:43 1995
  4346. @@ -44,7 +44,7 @@
  4347.  int umsdos_file_write_kmem(
  4348.      struct inode *inode,
  4349.      struct file *filp,
  4350. -    char *buf,
  4351. +    const char *buf,
  4352.      int count)
  4353.  {
  4354.      int ret;
  4355. diff -u --recursive --new-file v1.3.14/linux/fs/umsdos/file.c linux/fs/umsdos/file.c
  4356. --- v1.3.14/linux/fs/umsdos/file.c    Wed Jan 25 09:25:39 1995
  4357. +++ linux/fs/umsdos/file.c    Tue Aug  1 10:02:43 1995
  4358. @@ -49,7 +49,7 @@
  4359.  static int UMSDOS_file_write(
  4360.      struct inode *inode,
  4361.      struct file *filp,
  4362. -    char *buf,
  4363. +    const char *buf,
  4364.      int count)
  4365.  {
  4366.      return msdos_file_write(inode,filp,buf,count);
  4367. diff -u --recursive --new-file v1.3.14/linux/fs/umsdos/mangle.c linux/fs/umsdos/mangle.c
  4368. --- v1.3.14/linux/fs/umsdos/mangle.c    Wed Jan 25 09:25:39 1995
  4369. +++ linux/fs/umsdos/mangle.c    Tue Aug  1 10:02:44 1995
  4370. @@ -175,7 +175,7 @@
  4371.                  like this.
  4372.              */
  4373.              int i;
  4374. -            static char *spc = "\"*+,/:;<=>?[\\]|~";
  4375. +            static const char *spc = "\"*+,/:;<=>?[\\]|~";
  4376.              is_init = 1;
  4377.              for (i=0; i<=32; i++) lkp[i] = '#';
  4378.              for (i=33; i<'A'; i++) lkp[i] = (char)i;
  4379. diff -u --recursive --new-file v1.3.14/linux/fs/umsdos/namei.c linux/fs/umsdos/namei.c
  4380. --- v1.3.14/linux/fs/umsdos/namei.c    Wed Jan 25 09:25:39 1995
  4381. +++ linux/fs/umsdos/namei.c    Tue Aug  1 10:02:44 1995
  4382. @@ -450,7 +450,7 @@
  4383.          struct file filp;
  4384.          filp.f_pos = 0;
  4385.          /* Make the inode acceptable to MSDOS */
  4386. -        ret = umsdos_file_write_kmem (inode,&filp,(char*)symname,len);
  4387. +        ret = umsdos_file_write_kmem (inode,&filp,symname,len);
  4388.          iput (inode);
  4389.          if (ret >= 0){
  4390.              if (ret != len){
  4391. diff -u --recursive --new-file v1.3.14/linux/fs/xiafs/file.c linux/fs/xiafs/file.c
  4392. --- v1.3.14/linux/fs/xiafs/file.c    Tue Jun 27 14:11:44 1995
  4393. +++ linux/fs/xiafs/file.c    Tue Aug  1 10:02:44 1995
  4394. @@ -33,7 +33,7 @@
  4395.  #define MAX(a,b) (((a)>(b))?(a):(b))
  4396.  
  4397.  static int xiafs_file_read(struct inode *, struct file *, char *, int);
  4398. -static int xiafs_file_write(struct inode *, struct file *, char *, int);
  4399. +static int xiafs_file_write(struct inode *, struct file *, const char *, int);
  4400.  
  4401.  /*
  4402.   * We have mostly NULL's here: the current defaults are ok for
  4403. @@ -191,7 +191,7 @@
  4404.  }
  4405.  
  4406.  static int 
  4407. -xiafs_file_write(struct inode * inode, struct file * filp, char * buf, int count)
  4408. +xiafs_file_write(struct inode * inode, struct file * filp, const char * buf, int count)
  4409.  {
  4410.      off_t pos;
  4411.      int written, c;
  4412. diff -u --recursive --new-file v1.3.14/linux/include/asm-alpha/checksum.h linux/include/asm-alpha/checksum.h
  4413. --- v1.3.14/linux/include/asm-alpha/checksum.h    Fri Jul  7 08:54:53 1995
  4414. +++ linux/include/asm-alpha/checksum.h    Tue Aug  1 10:02:44 1995
  4415. @@ -30,7 +30,7 @@
  4416.   *
  4417.   * it's best to have buff aligned on a 32-bit boundary
  4418.   */
  4419. -extern unsigned int csum_partial(unsigned char * buff, int len, unsigned int sum);
  4420. +extern unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum);
  4421.  
  4422.  /*
  4423.   * the same as csum_partial, but copies from src while it
  4424. @@ -39,7 +39,7 @@
  4425.   * here even more important to align src and dst on a 32-bit (or even
  4426.   * better 64-bit) boundary
  4427.   */
  4428. -unsigned int csum_partial_copy( char *src, char *dst, int len, int sum);
  4429. +unsigned int csum_partial_copy( const char *src, char *dst, int len, int sum);
  4430.  
  4431.  /*
  4432.   * the same as csum_partial, but copies from user space (but on the alpha
  4433. diff -u --recursive --new-file v1.3.14/linux/include/asm-alpha/dma.h linux/include/asm-alpha/dma.h
  4434. --- v1.3.14/linux/include/asm-alpha/dma.h    Tue Jun 27 14:11:44 1995
  4435. +++ linux/include/asm-alpha/dma.h    Tue Aug  1 10:02:44 1995
  4436. @@ -294,7 +294,7 @@
  4437.  
  4438.  
  4439.  /* These are in kernel/dma.c: */
  4440. -extern int request_dma(unsigned int dmanr, char * device_id);    /* reserve a DMA channel */
  4441. +extern int request_dma(unsigned int dmanr, const char * device_id);    /* reserve a DMA channel */
  4442.  extern void free_dma(unsigned int dmanr);    /* release it again */
  4443.  
  4444.  
  4445. diff -u --recursive --new-file v1.3.14/linux/include/asm-i386/checksum.h linux/include/asm-i386/checksum.h
  4446. --- v1.3.14/linux/include/asm-i386/checksum.h    Fri Jul  7 08:54:53 1995
  4447. +++ linux/include/asm-i386/checksum.h    Tue Aug  1 10:02:44 1995
  4448. @@ -13,7 +13,7 @@
  4449.   *
  4450.   * it's best to have buff aligned on a 32-bit boundary
  4451.   */
  4452. -unsigned int csum_partial(unsigned char * buff, int len, unsigned int sum);
  4453. +unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum);
  4454.  
  4455.  /*
  4456.   * the same as csum_partial, but copies from src while it
  4457. @@ -23,7 +23,7 @@
  4458.   * better 64-bit) boundary
  4459.   */
  4460.  
  4461. -unsigned int csum_partial_copy( char *src, char *dst, int len, int sum);
  4462. +unsigned int csum_partial_copy( const char *src, char *dst, int len, int sum);
  4463.  
  4464.  
  4465.  /*
  4466. @@ -33,7 +33,7 @@
  4467.   * better 64-bit) boundary
  4468.   */
  4469.  
  4470. -unsigned int csum_partial_copy_fromuser( char *src, char *dst, int len, int sum);
  4471. +unsigned int csum_partial_copy_fromuser(const char *src, char *dst, int len, int sum);
  4472.  
  4473.  /*
  4474.   *    This is a version of ip_compute_csum() optimized for IP headers,
  4475. diff -u --recursive --new-file v1.3.14/linux/include/asm-i386/dma.h linux/include/asm-i386/dma.h
  4476. --- v1.3.14/linux/include/asm-i386/dma.h    Sun Jan  1 19:49:18 1995
  4477. +++ linux/include/asm-i386/dma.h    Tue Aug  1 10:02:44 1995
  4478. @@ -264,7 +264,7 @@
  4479.  
  4480.  
  4481.  /* These are in kernel/dma.c: */
  4482. -extern int request_dma(unsigned int dmanr, char * device_id);    /* reserve a DMA channel */
  4483. +extern int request_dma(unsigned int dmanr, const char * device_id);    /* reserve a DMA channel */
  4484.  extern void free_dma(unsigned int dmanr);    /* release it again */
  4485.  
  4486.  
  4487. diff -u --recursive --new-file v1.3.14/linux/include/asm-mips/dma.h linux/include/asm-mips/dma.h
  4488. --- v1.3.14/linux/include/asm-mips/dma.h    Sun Jan 15 22:26:01 1995
  4489. +++ linux/include/asm-mips/dma.h    Tue Aug  1 10:02:44 1995
  4490. @@ -267,7 +267,7 @@
  4491.  
  4492.  
  4493.  /* These are in kernel/dma.c: */
  4494. -extern int request_dma(unsigned int dmanr, char * device_id);    /* reserve a DMA channel */
  4495. +extern int request_dma(unsigned int dmanr, const char * device_id);    /* reserve a DMA channel */
  4496.  extern void free_dma(unsigned int dmanr);    /* release it again */
  4497.  
  4498.  
  4499. diff -u --recursive --new-file v1.3.14/linux/include/linux/bios32.h linux/include/linux/bios32.h
  4500. --- v1.3.14/linux/include/linux/bios32.h    Fri Jun 16 22:02:55 1995
  4501. +++ linux/include/linux/bios32.h    Tue Aug  1 10:02:44 1995
  4502. @@ -56,6 +56,6 @@
  4503.                        unsigned char where, unsigned short val);
  4504.  extern pcibios_write_config_dword (unsigned char bus, unsigned char dev_fn,
  4505.                     unsigned char where, unsigned int val);
  4506. -extern char *pcibios_strerror (int error);
  4507. +extern const char *pcibios_strerror (int error);
  4508.  
  4509.  #endif /* BIOS32_H */
  4510. diff -u --recursive --new-file v1.3.14/linux/include/linux/ext2_fs.h linux/include/linux/ext2_fs.h
  4511. --- v1.3.14/linux/include/linux/ext2_fs.h    Tue Jul 11 10:02:59 1995
  4512. +++ linux/include/linux/ext2_fs.h    Tue Aug  1 10:02:44 1995
  4513. @@ -427,7 +427,7 @@
  4514.  extern unsigned long ext2_count_free (struct buffer_head *, unsigned);
  4515.  
  4516.  /* dir.c */
  4517. -extern int ext2_check_dir_entry (char *, struct inode *,
  4518. +extern int ext2_check_dir_entry (const char *, struct inode *,
  4519.                   struct ext2_dir_entry *, struct buffer_head *,
  4520.                   unsigned long);
  4521.  
  4522. diff -u --recursive --new-file v1.3.14/linux/include/linux/fd.h linux/include/linux/fd.h
  4523. --- v1.3.14/linux/include/linux/fd.h    Tue Jun 27 14:11:46 1995
  4524. +++ linux/include/linux/fd.h    Tue Aug  1 10:02:44 1995
  4525. @@ -69,7 +69,7 @@
  4526.              rate,        /* data rate. |= 0x40 for perpendicular */
  4527.              spec1,        /* stepping rate, head unload time */
  4528.              fmt_gap;    /* gap2 size */
  4529. -    char           * name; /* used only for predefined formats */
  4530. +    const char    * name;        /* used only for predefined formats */
  4531.  };
  4532.  
  4533.  struct format_descr {
  4534. diff -u --recursive --new-file v1.3.14/linux/include/linux/fs.h linux/include/linux/fs.h
  4535. --- v1.3.14/linux/include/linux/fs.h    Tue Jun 27 14:11:46 1995
  4536. +++ linux/include/linux/fs.h    Tue Aug  1 10:02:44 1995
  4537. @@ -336,7 +336,7 @@
  4538.  struct file_operations {
  4539.      int (*lseek) (struct inode *, struct file *, off_t, int);
  4540.      int (*read) (struct inode *, struct file *, char *, int);
  4541. -    int (*write) (struct inode *, struct file *, char *, int);
  4542. +    int (*write) (struct inode *, struct file *, const char *, int);
  4543.      int (*readdir) (struct inode *, struct file *, void *, filldir_t);
  4544.      int (*select) (struct inode *, struct file *, int, select_table *);
  4545.      int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);
  4546. @@ -381,7 +381,7 @@
  4547.  
  4548.  struct file_system_type {
  4549.      struct super_block *(*read_super) (struct super_block *, void *, int);
  4550. -    char *name;
  4551. +    const char *name;
  4552.      int requires_dev;
  4553.      struct file_system_type * next;
  4554.  };
  4555. @@ -419,7 +419,7 @@
  4556.  extern struct file_operations write_pipe_fops;
  4557.  extern struct file_operations rdwr_pipe_fops;
  4558.  
  4559. -extern struct file_system_type *get_fs_type(char *name);
  4560. +extern struct file_system_type *get_fs_type(const char *name);
  4561.  
  4562.  extern int fs_may_mount(dev_t dev);
  4563.  extern int fs_may_umount(dev_t dev, struct inode * mount_root);
  4564. @@ -515,8 +515,8 @@
  4565.  extern int block_read(struct inode *, struct file *, char *, int);
  4566.  extern int read_ahead[];
  4567.  
  4568. -extern int char_write(struct inode *, struct file *, char *, int);
  4569. -extern int block_write(struct inode *, struct file *, char *, int);
  4570. +extern int char_write(struct inode *, struct file *, const char *, int);
  4571. +extern int block_write(struct inode *, struct file *, const char *, int);
  4572.  
  4573.  extern int generic_mmap(struct inode *, struct file *, struct vm_area_struct *);
  4574.  
  4575. diff -u --recursive --new-file v1.3.14/linux/include/linux/genhd.h linux/include/linux/genhd.h
  4576. --- v1.3.14/linux/include/linux/genhd.h    Mon Jul 31 15:59:02 1995
  4577. +++ linux/include/linux/genhd.h    Tue Aug  1 10:02:44 1995
  4578. @@ -41,7 +41,7 @@
  4579.  
  4580.  struct gendisk {
  4581.      int major;            /* major number of driver */
  4582. -    char *major_name;        /* name of major driver */
  4583. +    const char *major_name;        /* name of major driver */
  4584.      int minor_shift;        /* number of times minor is shifted to
  4585.                         get real minor */
  4586.      int max_p;            /* maximum partitions per device */
  4587. diff -u --recursive --new-file v1.3.14/linux/include/linux/inet.h linux/include/linux/inet.h
  4588. --- v1.3.14/linux/include/linux/inet.h    Fri Jan 27 12:17:02 1995
  4589. +++ linux/include/linux/inet.h    Tue Aug  1 10:02:46 1995
  4590. @@ -46,7 +46,7 @@
  4591.  
  4592.  extern void        inet_proto_init(struct net_proto *pro);
  4593.  extern char        *in_ntoa(unsigned long in);
  4594. -extern unsigned long    in_aton(char *str);
  4595. +extern unsigned long    in_aton(const char *str);
  4596.  
  4597.  #endif
  4598.  #endif    /* _LINUX_INET_H */
  4599. diff -u --recursive --new-file v1.3.14/linux/include/linux/module.h linux/include/linux/module.h
  4600. --- v1.3.14/linux/include/linux/module.h    Tue Jun 27 14:11:46 1995
  4601. +++ linux/include/linux/module.h    Tue Aug  1 10:02:46 1995
  4602. @@ -46,7 +46,7 @@
  4603.  
  4604.  struct internal_symbol {
  4605.      void *addr;
  4606. -    char *name;
  4607. +    const char *name;
  4608.      };
  4609.  
  4610.  struct symbol_table { /* received from "insmod" */
  4611. @@ -64,7 +64,7 @@
  4612.      struct module *next;
  4613.      struct module_ref *ref;    /* the list of modules that refer to me */
  4614.      struct symbol_table *symtab;
  4615. -    char *name;
  4616. +    const char *name;
  4617.      int size;            /* size of module in pages */
  4618.      void* addr;            /* address of module */
  4619.      int state;
  4620. diff -u --recursive --new-file v1.3.14/linux/include/linux/msdos_fs.h linux/include/linux/msdos_fs.h
  4621. --- v1.3.14/linux/include/linux/msdos_fs.h    Mon Jun 12 16:49:42 1995
  4622. +++ linux/include/linux/msdos_fs.h    Tue Aug  1 10:02:46 1995
  4623. @@ -33,8 +33,8 @@
  4624.      /* attribute bits that are copied "as is" */
  4625.  
  4626.  #define DELETED_FLAG 0xe5 /* marks file as deleted when in name[0] */
  4627. -#define IS_FREE(n) (!*(n) || *(unsigned char *) (n) == DELETED_FLAG || \
  4628. -  *(unsigned char *) (n) == FD_FILL_BYTE)
  4629. +#define IS_FREE(n) (!*(n) || *(const unsigned char *) (n) == DELETED_FLAG || \
  4630. +  *(const unsigned char *) (n) == FD_FILL_BYTE)
  4631.  
  4632.  #define MSDOS_VALID_MODE (S_IFREG | S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO)
  4633.      /* valid file mode bits */
  4634. @@ -112,7 +112,7 @@
  4635.  
  4636.  /* misc.c */
  4637.  
  4638. -extern void fs_panic(struct super_block *s,char *msg);
  4639. +extern void fs_panic(struct super_block *s,const char *msg);
  4640.  extern int is_binary(char conversion,char *extension);
  4641.  extern void lock_creation(void);
  4642.  extern void unlock_creation(void);
  4643. @@ -123,7 +123,7 @@
  4644.  extern void date_unix2dos(int unix_date,__u16 *time, __u16 *date);
  4645.  extern int msdos_get_entry(struct inode *dir,loff_t *pos,struct buffer_head **bh,
  4646.      struct msdos_dir_entry **de);
  4647. -extern int msdos_scan(struct inode *dir,char *name,struct buffer_head **res_bh,
  4648. +extern int msdos_scan(struct inode *dir,const char *name,struct buffer_head **res_bh,
  4649.      struct msdos_dir_entry **res_de,int *ino);
  4650.  extern int msdos_parent_ino(struct inode *dir,int locked);
  4651.  extern int msdos_subdirs(struct inode *dir);
  4652. @@ -175,7 +175,7 @@
  4653.  extern struct inode_operations msdos_file_inode_operations;
  4654.  extern struct inode_operations msdos_file_inode_operations_1024;
  4655.  extern int msdos_file_read(struct inode *, struct file *, char *, int);
  4656. -extern int msdos_file_write(struct inode *, struct file *, char *, int);
  4657. +extern int msdos_file_write(struct inode *, struct file *, const char *, int);
  4658.  extern struct inode_operations msdos_file_inode_operations_no_bmap;
  4659.  
  4660.  extern void msdos_truncate(struct inode *inode);
  4661. diff -u --recursive --new-file v1.3.14/linux/include/linux/net.h linux/include/linux/net.h
  4662. --- v1.3.14/linux/include/linux/net.h    Thu Feb 23 13:26:54 1995
  4663. +++ linux/include/linux/net.h    Tue Aug  1 10:02:46 1995
  4664. @@ -102,18 +102,18 @@
  4665.               int *usockaddr_len, int peer);
  4666.    int    (*read)        (struct socket *sock, char *ubuf, int size,
  4667.               int nonblock);
  4668. -  int    (*write)    (struct socket *sock, char *ubuf, int size,
  4669. +  int    (*write)    (struct socket *sock, const char *ubuf, int size,
  4670.               int nonblock);
  4671.    int    (*select)    (struct socket *sock, int sel_type,
  4672.               select_table *wait);
  4673.    int    (*ioctl)    (struct socket *sock, unsigned int cmd,
  4674.               unsigned long arg);
  4675.    int    (*listen)    (struct socket *sock, int len);
  4676. -  int    (*send)        (struct socket *sock, void *buff, int len, int nonblock,
  4677. +  int    (*send)        (struct socket *sock, const void *buff, int len, int nonblock,
  4678.               unsigned flags);
  4679.    int    (*recv)        (struct socket *sock, void *buff, int len, int nonblock,
  4680.               unsigned flags);
  4681. -  int    (*sendto)    (struct socket *sock, void *buff, int len, int nonblock,
  4682. +  int    (*sendto)    (struct socket *sock, const void *buff, int len, int nonblock,
  4683.               unsigned flags, struct sockaddr *, int addr_len);
  4684.    int    (*recvfrom)    (struct socket *sock, void *buff, int len, int nonblock,
  4685.               unsigned flags, struct sockaddr *, int *addr_len);
  4686. @@ -127,7 +127,7 @@
  4687.  };
  4688.  
  4689.  struct net_proto {
  4690. -    char *name;        /* Protocol name */
  4691. +    const char *name;        /* Protocol name */
  4692.      void (*init_func)(struct net_proto *);    /* Bootstrap */
  4693.  };
  4694.  
  4695. diff -u --recursive --new-file v1.3.14/linux/include/linux/netdevice.h linux/include/linux/netdevice.h
  4696. --- v1.3.14/linux/include/linux/netdevice.h    Tue Jul 18 16:28:58 1995
  4697. +++ linux/include/linux/netdevice.h    Tue Aug  1 11:31:37 1995
  4698. @@ -196,7 +196,7 @@
  4699.  
  4700.  extern void        dev_add_pack(struct packet_type *pt);
  4701.  extern void        dev_remove_pack(struct packet_type *pt);
  4702. -extern struct device    *dev_get(char *name);
  4703. +extern struct device    *dev_get(const char *name);
  4704.  extern int        dev_open(struct device *dev);
  4705.  extern int        dev_close(struct device *dev);
  4706.  extern void        dev_queue_xmit(struct sk_buff *skb, struct device *dev,
  4707. diff -u --recursive --new-file v1.3.14/linux/include/linux/nfs_fs.h linux/include/linux/nfs_fs.h
  4708. --- v1.3.14/linux/include/linux/nfs_fs.h    Thu Oct  6 08:28:18 1994
  4709. +++ linux/include/linux/nfs_fs.h    Tue Aug  1 10:02:47 1995
  4710. @@ -63,7 +63,7 @@
  4711.               int offset, int count, char *data,
  4712.               struct nfs_fattr *fattr, int fs);
  4713.  extern int nfs_proc_write(struct nfs_server *server, struct nfs_fh *fhandle,
  4714. -              int offset, int count, char *data,
  4715. +              int offset, int count, const char *data,
  4716.                struct nfs_fattr *fattr);
  4717.  extern int nfs_proc_create(struct nfs_server *server, struct nfs_fh *dir,
  4718.                 const char *name, struct nfs_sattr *sattr,
  4719. diff -u --recursive --new-file v1.3.14/linux/include/linux/pci.h linux/include/linux/pci.h
  4720. --- v1.3.14/linux/include/linux/pci.h    Tue Jul 11 10:02:59 1995
  4721. +++ linux/include/linux/pci.h    Wed Aug  2 09:41:45 1995
  4722. @@ -172,6 +172,7 @@
  4723.  #define PCI_DEVICE_ID_ADAPTEC_2940    0x7178
  4724.  #define PCI_DEVICE_ID_ADAPTEC_294x    0x7078
  4725.  #define PCI_DEVICE_ID_ADAPTEC_7850    0x5078
  4726. +#define PCI_DEVICE_ID_ADAPTEC_7872    0x7278
  4727.  
  4728.  #define PCI_VENDOR_ID_DPT               0x1044   
  4729.  #define PCI_DEVICE_ID_DPT               0xa400  
  4730. @@ -351,6 +352,8 @@
  4731.  #define PCI_VENDOR_ID_VORTEX        0x1119
  4732.  #define PCI_DEVICE_ID_VORTEX_GDT    0x0001
  4733.  
  4734. +#define PCI_VENDOR_ID_HP        0x103c
  4735. +#define PCI_DEVICE_ID_HP_J2585A        0x1030
  4736.  
  4737.  /*
  4738.   * The PCI interface treats multi-function devices as independent
  4739. @@ -430,7 +433,7 @@
  4740.  
  4741.  extern struct pci_dev_info *pci_lookup_dev (unsigned int vendor,
  4742.                          unsigned int dev);
  4743. -extern char *pci_strbioserr (int error);
  4744. +extern const char *pci_strbioserr (int error);
  4745.  extern const char *pci_strclass (unsigned int class);
  4746.  extern const char *pci_strvendor (unsigned int vendor);
  4747.  extern const char *pci_strdev (unsigned int vendor, unsigned int device);
  4748. diff -u --recursive --new-file v1.3.14/linux/include/linux/personality.h linux/include/linux/personality.h
  4749. --- v1.3.14/linux/include/linux/personality.h    Sun Jan 29 12:58:46 1995
  4750. +++ linux/include/linux/personality.h    Tue Aug  1 10:02:47 1995
  4751. @@ -32,7 +32,7 @@
  4752.   * offset of the handler is hard coded in kernel/sys_call.S.
  4753.   */
  4754.  struct exec_domain {
  4755. -    char *name;
  4756. +    const char *name;
  4757.      lcall7_func handler;
  4758.      unsigned char pers_low, pers_high;
  4759.      unsigned long * signal_map;
  4760. diff -u --recursive --new-file v1.3.14/linux/include/linux/proc_fs.h linux/include/linux/proc_fs.h
  4761. --- v1.3.14/linux/include/linux/proc_fs.h    Fri Jul  7 13:42:58 1995
  4762. +++ linux/include/linux/proc_fs.h    Tue Aug  1 10:02:47 1995
  4763. @@ -139,7 +139,7 @@
  4764.  struct proc_dir_entry {
  4765.      unsigned short low_ino;
  4766.      unsigned short namelen;
  4767. -    char * name;
  4768. +    const char * name;
  4769.  };
  4770.  
  4771.  extern struct super_block *proc_read_super(struct super_block *,void *,int);
  4772. diff -u --recursive --new-file v1.3.14/linux/include/linux/smb_fs.h linux/include/linux/smb_fs.h
  4773. --- v1.3.14/linux/include/linux/smb_fs.h    Tue Jul 11 10:02:59 1995
  4774. +++ linux/include/linux/smb_fs.h    Tue Aug  1 10:02:47 1995
  4775. @@ -130,7 +130,7 @@
  4776.  int smb_proc_read(struct smb_server *server, struct smb_dirent *finfo, 
  4777.            off_t offset, long count, char *data, int fs);
  4778.  int smb_proc_write(struct smb_server *server, struct smb_dirent *finfo,
  4779. -           off_t offset, int count, char *data);
  4780. +           off_t offset, int count, const char *data);
  4781.  int smb_proc_create(struct smb_server *server, const char *path,
  4782.                      int len, struct smb_dirent *entry);
  4783.  int smb_proc_mknew(struct smb_server *server, const char *path, int len,
  4784. diff -u --recursive --new-file v1.3.14/linux/include/linux/tty_driver.h linux/include/linux/tty_driver.h
  4785. --- v1.3.14/linux/include/linux/tty_driver.h    Tue Jun  6 11:22:13 1995
  4786. +++ linux/include/linux/tty_driver.h    Tue Aug  1 10:02:47 1995
  4787. @@ -98,7 +98,7 @@
  4788.  
  4789.  struct tty_driver {
  4790.      int    magic;        /* magic number for this structure */
  4791. -    char    *name;
  4792. +    const char    *name;
  4793.      int    name_base;    /* offset of printed name */
  4794.      short    major;        /* major device number */
  4795.      short    minor_start;    /* start of minor device number*/
  4796. @@ -124,7 +124,7 @@
  4797.      int  (*open)(struct tty_struct * tty, struct file * filp);
  4798.      void (*close)(struct tty_struct * tty, struct file * filp);
  4799.      int  (*write)(struct tty_struct * tty, int from_user,
  4800. -              unsigned char *buf, int count);
  4801. +              const unsigned char *buf, int count);
  4802.      void (*put_char)(struct tty_struct *tty, unsigned char ch);
  4803.      void (*flush_chars)(struct tty_struct *tty);
  4804.      int  (*write_room)(struct tty_struct *tty);
  4805. diff -u --recursive --new-file v1.3.14/linux/include/linux/tty_ldisc.h linux/include/linux/tty_ldisc.h
  4806. --- v1.3.14/linux/include/linux/tty_ldisc.h    Fri May 27 10:47:29 1994
  4807. +++ linux/include/linux/tty_ldisc.h    Tue Aug  1 10:02:47 1995
  4808. @@ -22,7 +22,7 @@
  4809.      int    (*read)(struct tty_struct * tty, struct file * file,
  4810.              unsigned char * buf, unsigned int nr);
  4811.      int    (*write)(struct tty_struct * tty, struct file * file,
  4812. -             unsigned char * buf, unsigned int nr);    
  4813. +             const unsigned char * buf, unsigned int nr);    
  4814.      int    (*ioctl)(struct tty_struct * tty, struct file * file,
  4815.               unsigned int cmd, unsigned long arg);
  4816.      void    (*set_termios)(struct tty_struct *tty, struct termios * old);
  4817. @@ -33,7 +33,7 @@
  4818.      /*
  4819.       * The following routines are called from below.
  4820.       */
  4821. -    void    (*receive_buf)(struct tty_struct *, unsigned char *cp,
  4822. +    void    (*receive_buf)(struct tty_struct *, const unsigned char *cp,
  4823.                     char *fp, int count);
  4824.      int    (*receive_room)(struct tty_struct *);
  4825.      void    (*write_wakeup)(struct tty_struct *);
  4826. diff -u --recursive --new-file v1.3.14/linux/include/linux/umsdos_fs.p linux/include/linux/umsdos_fs.p
  4827. --- v1.3.14/linux/include/linux/umsdos_fs.p    Tue Jun 27 14:11:46 1995
  4828. +++ linux/include/linux/umsdos_fs.p    Tue Aug  1 10:02:47 1995
  4829. @@ -26,7 +26,7 @@
  4830.       int count);
  4831.  int umsdos_file_write_kmem (struct inode *inode,
  4832.       struct file *filp,
  4833. -     char *buf,
  4834. +     const char *buf,
  4835.       int count);
  4836.  int umsdos_emd_dir_write (struct inode *emd_dir,
  4837.       struct file *filp,
  4838. diff -u --recursive --new-file v1.3.14/linux/include/linux/xd.h linux/include/linux/xd.h
  4839. --- v1.3.14/linux/include/linux/xd.h    Sun Jan 22 00:02:55 1995
  4840. +++ linux/include/linux/xd.h    Tue Aug  1 10:02:47 1995
  4841. @@ -98,10 +98,10 @@
  4842.  /* this structure defines a ROM BIOS signature */
  4843.  typedef struct {
  4844.      u_long offset;
  4845. -    char *string;
  4846. +    const char *string;
  4847.      void (*init_controller)(u_char *address);
  4848.      void (*init_drive)(u_char drive);
  4849. -    char *name;
  4850. +    const char *name;
  4851.  } XD_SIGNATURE;
  4852.  
  4853.  u_long xd_init (u_long mem_start,u_long mem_end);
  4854. diff -u --recursive --new-file v1.3.14/linux/include/net/datalink.h linux/include/net/datalink.h
  4855. --- v1.3.14/linux/include/net/datalink.h    Tue Jun  6 11:22:17 1995
  4856. +++ linux/include/net/datalink.h    Tue Aug  1 10:02:47 1995
  4857. @@ -4,7 +4,7 @@
  4858.  struct datalink_proto {
  4859.      unsigned short    type_len;
  4860.      unsigned char    type[8];
  4861. -    char        *string_name;
  4862. +    const char    *string_name;
  4863.      unsigned short    header_length;
  4864.      int    (*rcvfunc)(struct sk_buff *, struct device *, 
  4865.                  struct packet_type *);
  4866. diff -u --recursive --new-file v1.3.14/linux/include/net/ip.h linux/include/net/ip.h
  4867. --- v1.3.14/linux/include/net/ip.h    Thu Jul 13 16:20:21 1995
  4868. +++ linux/include/net/ip.h    Tue Aug  1 10:02:47 1995
  4869. @@ -98,12 +98,12 @@
  4870.  extern int         ip_getsockopt(struct sock *sk, int level, int optname, char *optval, int *optlen);
  4871.  extern void        ip_init(void);
  4872.  extern int        ip_build_xmit(struct sock *sk,
  4873. -                      void getfrag (void *,
  4874. +                      void getfrag (const void *,
  4875.                              int,
  4876.                              char *,
  4877.                              unsigned int,
  4878.                              unsigned int),
  4879. -                      void *frag,
  4880. +                      const void *frag,
  4881.                        unsigned short int length,
  4882.                        int daddr,
  4883.                        int flags,
  4884. diff -u --recursive --new-file v1.3.14/linux/include/net/protocol.h linux/include/net/protocol.h
  4885. --- v1.3.14/linux/include/net/protocol.h    Tue Jun  6 11:22:17 1995
  4886. +++ linux/include/net/protocol.h    Tue Aug  1 10:02:47 1995
  4887. @@ -44,7 +44,7 @@
  4888.    unsigned char        protocol;
  4889.    unsigned char        copy:1;
  4890.    void            *data;
  4891. -  char             *name;
  4892. +  const char        *name;
  4893.  };
  4894.  
  4895.  
  4896. diff -u --recursive --new-file v1.3.14/linux/include/net/sock.h linux/include/net/sock.h
  4897. --- v1.3.14/linux/include/net/sock.h    Fri Jul  7 08:54:55 1995
  4898. +++ linux/include/net/sock.h    Tue Aug  1 10:02:47 1995
  4899. @@ -220,10 +220,10 @@
  4900.    void            (*close)(struct sock *sk, int timeout);
  4901.    int            (*read)(struct sock *sk, unsigned char *to,
  4902.                  int len, int nonblock, unsigned flags);
  4903. -  int            (*write)(struct sock *sk, unsigned char *to,
  4904. +  int            (*write)(struct sock *sk, const unsigned char *to,
  4905.                   int len, int nonblock, unsigned flags);
  4906.    int            (*sendto)(struct sock *sk,
  4907. -                  unsigned char *from, int len, int noblock,
  4908. +                  const unsigned char *from, int len, int noblock,
  4909.                    unsigned flags, struct sockaddr_in *usin,
  4910.                    int addr_len);
  4911.    int            (*recvfrom)(struct sock *sk,
  4912. diff -u --recursive --new-file v1.3.14/linux/init/main.c linux/init/main.c
  4913. --- v1.3.14/linux/init/main.c    Fri Jul  7 08:54:55 1995
  4914. +++ linux/init/main.c    Tue Aug  1 10:02:47 1995
  4915. @@ -145,7 +145,7 @@
  4916.  }
  4917.  
  4918.  struct {
  4919. -    char *str;
  4920. +    const char *str;
  4921.      void (*setup_func)(char *, int *);
  4922.  } bootsetups[] = {
  4923.      { "reserve=", reserve_setup },
  4924. @@ -305,7 +305,7 @@
  4925.  static void parse_options(char *line)
  4926.  {
  4927.      char *next;
  4928. -    static char *devnames[] = { "hda", "hdb", "hdc", "hdd", "sda", "sdb", "sdc", "sdd", "sde", "fd", "xda", "xdb", NULL };
  4929. +    static const char *devnames[] = { "hda", "hdb", "hdc", "hdd", "sda", "sdb", "sdc", "sdd", "sde", "fd", "xda", "xdb", NULL };
  4930.      static int devnums[]    = { 0x300, 0x340, 0x1600, 0x1640, 0x800, 0x810, 0x820, 0x830, 0x840, 0x200, 0xD00, 0xD40, 0};
  4931.      int args, envs;
  4932.  
  4933. diff -u --recursive --new-file v1.3.14/linux/init/version.c linux/init/version.c
  4934. --- v1.3.14/linux/init/version.c    Thu Jan  5 13:55:40 1995
  4935. +++ linux/init/version.c    Tue Aug  1 10:02:47 1995
  4936. @@ -15,6 +15,6 @@
  4937.      UTS_MACHINE, UTS_DOMAINNAME
  4938.  };
  4939.  
  4940. -char *linux_banner = 
  4941. +const char *linux_banner = 
  4942.      "Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@"
  4943.      LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n";
  4944. diff -u --recursive --new-file v1.3.14/linux/kernel/dma.c linux/kernel/dma.c
  4945. --- v1.3.14/linux/kernel/dma.c    Tue Jul 18 16:28:59 1995
  4946. +++ linux/kernel/dma.c    Tue Aug  1 10:02:47 1995
  4947. @@ -40,7 +40,7 @@
  4948.  
  4949.  struct dma_chan {
  4950.      int  lock;
  4951. -    char *device_id;
  4952. +    const char *device_id;
  4953.  };
  4954.  
  4955.  static struct dma_chan dma_chan_busy[MAX_DMA_CHANNELS] = {
  4956. @@ -69,7 +69,7 @@
  4957.  } /* get_dma_list */
  4958.  
  4959.  
  4960. -int request_dma(unsigned int dmanr, char * device_id)
  4961. +int request_dma(unsigned int dmanr, const char * device_id)
  4962.  {
  4963.      if (dmanr >= MAX_DMA_CHANNELS)
  4964.          return -EINVAL;
  4965. diff -u --recursive --new-file v1.3.14/linux/kernel/itimer.c linux/kernel/itimer.c
  4966. --- v1.3.14/linux/kernel/itimer.c    Mon Jul 31 15:59:03 1995
  4967. +++ linux/kernel/itimer.c    Tue Aug  1 10:56:13 1995
  4968. @@ -15,11 +15,26 @@
  4969.  
  4970.  #include <asm/segment.h>
  4971.  
  4972. +/*
  4973. + * change timeval to jiffies, trying to avoid the 
  4974. + * most obvious overflows..
  4975. + *
  4976. + * The tv_*sec values are signed, but nothing seems to 
  4977. + * indicate whether we really should use them as signed values
  4978. + * when doing itimers. POSIX doesn't mention this (but if
  4979. + * alarm() uses itimers without checking, we have to use unsigned
  4980. + * arithmetic).
  4981. + */
  4982.  static unsigned long tvtojiffies(struct timeval *value)
  4983.  {
  4984. -    return((unsigned long )value->tv_sec * HZ +
  4985. -        (unsigned long )(value->tv_usec + (1000000 / HZ - 1)) /
  4986. -        (1000000 / HZ));
  4987. +    unsigned long sec = (unsigned) value->tv_sec;
  4988. +    unsigned long usec = (unsigned) value->tv_usec;
  4989. +
  4990. +    if (sec > (unsigned) (LONG_MAX / HZ))
  4991. +        return LONG_MAX;
  4992. +    usec += 1000000 / HZ - 1;
  4993. +    usec /= 1000000 / HZ;
  4994. +    return HZ*sec+usec;
  4995.  }
  4996.  
  4997.  static void jiffiestotv(unsigned long jiffies, struct timeval *value)
  4998. diff -u --recursive --new-file v1.3.14/linux/kernel/module.c linux/kernel/module.c
  4999. --- v1.3.14/linux/kernel/module.c    Tue Jun 27 14:11:47 1995
  5000. +++ linux/kernel/module.c    Tue Aug  1 10:02:47 1995
  5001. @@ -512,7 +512,7 @@
  5002.  int get_module_list(char *buf)
  5003.  {
  5004.      char *p;
  5005. -    char *q;
  5006. +    const char *q;
  5007.      int i;
  5008.      struct module *mp;
  5009.      struct module_ref *ref;
  5010. diff -u --recursive --new-file v1.3.14/linux/kernel/sched.c linux/kernel/sched.c
  5011. --- v1.3.14/linux/kernel/sched.c    Mon Jul 31 15:59:03 1995
  5012. +++ linux/kernel/sched.c    Tue Aug  1 10:37:50 1995
  5013. @@ -713,7 +713,7 @@
  5014.      sti();
  5015.  }
  5016.  
  5017. -asmlinkage int sys_alarm(long seconds)
  5018. +asmlinkage unsigned int sys_alarm(unsigned int seconds)
  5019.  {
  5020.      struct itimerval it_new, it_old;
  5021.  
  5022. @@ -772,7 +772,7 @@
  5023.  static void show_task(int nr,struct task_struct * p)
  5024.  {
  5025.      unsigned long free;
  5026. -    static char * stat_nam[] = { "R", "S", "D", "Z", "T", "W" };
  5027. +    static const char * stat_nam[] = { "R", "S", "D", "Z", "T", "W" };
  5028.  
  5029.      printk("%-8s %3d ", p->comm, (p == current) ? -nr : nr);
  5030.      if (((unsigned) p->state) < sizeof(stat_nam)/sizeof(char *))
  5031. diff -u --recursive --new-file v1.3.14/linux/lib/vsprintf.c linux/lib/vsprintf.c
  5032. --- v1.3.14/linux/lib/vsprintf.c    Thu Mar  2 09:04:40 1995
  5033. +++ linux/lib/vsprintf.c    Tue Aug  1 10:02:48 1995
  5034. @@ -137,7 +137,7 @@
  5035.      unsigned long num;
  5036.      int i, base;
  5037.      char * str;
  5038. -    char *s;
  5039. +    const char *s;
  5040.  
  5041.      int flags;        /* flags to number() */
  5042.  
  5043. diff -u --recursive --new-file v1.3.14/linux/net/Changes linux/net/Changes
  5044. --- v1.3.14/linux/net/Changes    Thu Jul 13 16:20:21 1995
  5045. +++ linux/net/Changes    Mon Jul 31 18:51:45 1995
  5046. @@ -138,8 +138,19 @@
  5047.  o    Fixed multicast                    [IN]
  5048.  o    TCP does rerouting for most cases        [NOT WORKING YET]
  5049.  
  5050. -------->>>>>    1.3.?  <<<<<----------
  5051. +------->>>>>    1.3.14  <<<<<----------
  5052.  
  5053. +o    IPX works                    [IN]
  5054. +o    NetROM works                    [IN]
  5055. +o    AX.25 works                    [IN]
  5056. +o    Most modules need recompiling even though they
  5057. +    load OK                     [BLAME LINUS]
  5058. +
  5059. +------->>>>>   1.3.15  <<<<<---------
  5060. +o    Mike Shaver has started RFC1122 verification    [IN PROGRESS]
  5061. +o    Minor bug fixes                    [IN]
  5062. +
  5063. +------->>>> ???? <<<--------
  5064.  o    Finish merging the bridge code
  5065.  o    Device locking
  5066.  o    SIOCSLEEPRT patch
  5067. diff -u --recursive --new-file v1.3.14/linux/net/appletalk/ddp.c linux/net/appletalk/ddp.c
  5068. --- v1.3.14/linux/net/appletalk/ddp.c    Mon Jul 31 15:59:03 1995
  5069. +++ linux/net/appletalk/ddp.c    Tue Aug  1 10:02:48 1995
  5070. @@ -1457,7 +1457,7 @@
  5071.      return(0);
  5072.  }
  5073.  
  5074. -static int atalk_sendto(struct socket *sock, void *ubuf, int len, int noblock,
  5075. +static int atalk_sendto(struct socket *sock, const void *ubuf, int len, int noblock,
  5076.      unsigned flags, struct sockaddr *sat, int addr_len)
  5077.  {
  5078.      atalk_socket *sk=(atalk_socket *)sock->data;
  5079. @@ -1634,7 +1634,7 @@
  5080.      return len;
  5081.  }
  5082.  
  5083. -static int atalk_send(struct socket *sock, void *ubuf, int size, int noblock, unsigned flags)
  5084. +static int atalk_send(struct socket *sock, const void *ubuf, int size, int noblock, unsigned flags)
  5085.  {
  5086.      return atalk_sendto(sock,ubuf,size,noblock,flags,NULL,0);
  5087.  }
  5088. @@ -1690,7 +1690,7 @@
  5089.  }        
  5090.  
  5091.  
  5092. -static int atalk_write(struct socket *sock, char *ubuf, int size, int noblock)
  5093. +static int atalk_write(struct socket *sock, const char *ubuf, int size, int noblock)
  5094.  {
  5095.      return atalk_send(sock,ubuf,size,noblock,0);
  5096.  }
  5097. diff -u --recursive --new-file v1.3.14/linux/net/ax25/af_ax25.c linux/net/ax25/af_ax25.c
  5098. --- v1.3.14/linux/net/ax25/af_ax25.c    Mon Jul 31 15:59:03 1995
  5099. +++ linux/net/ax25/af_ax25.c    Tue Aug  1 10:02:48 1995
  5100. @@ -1566,7 +1566,7 @@
  5101.      return ax25_rcv(skb, dev, &port_call, ptype);
  5102.  }
  5103.  
  5104. -static int ax25_sendto(struct socket *sock, void *ubuf, int len, int noblock,
  5105. +static int ax25_sendto(struct socket *sock, const void *ubuf, int len, int noblock,
  5106.      unsigned flags, struct sockaddr *usip, int addr_len)
  5107.  {
  5108.      struct sock *sk = (struct sock *)sock->data;
  5109. @@ -1716,12 +1716,12 @@
  5110.          
  5111.  }
  5112.  
  5113. -static int ax25_send(struct socket *sock, void *ubuf, int size, int noblock, unsigned flags)
  5114. +static int ax25_send(struct socket *sock, const void *ubuf, int size, int noblock, unsigned flags)
  5115.  {
  5116.      return ax25_sendto(sock, ubuf, size, noblock, flags, NULL, 0);
  5117.  }
  5118.  
  5119. -static int ax25_write(struct socket *sock, char *ubuf, int size, int noblock)
  5120. +static int ax25_write(struct socket *sock, const char *ubuf, int size, int noblock)
  5121.  {
  5122.      return ax25_send(sock, ubuf, size, noblock, 0);
  5123.  }
  5124. @@ -1910,7 +1910,7 @@
  5125.  {
  5126.      ax25_cb *ax25;
  5127.      struct device *dev;
  5128. -    char *devname;
  5129. +    const char *devname;
  5130.      int len = 0;
  5131.      off_t pos = 0;
  5132.      off_t begin = 0;
  5133. diff -u --recursive --new-file v1.3.14/linux/net/core/dev.c linux/net/core/dev.c
  5134. --- v1.3.14/linux/net/core/dev.c    Tue Jul 25 18:21:24 1995
  5135. +++ linux/net/core/dev.c    Tue Aug  1 10:02:48 1995
  5136. @@ -185,7 +185,7 @@
  5137.   *    Find an interface by name.
  5138.   */
  5139.   
  5140. -struct device *dev_get(char *name)
  5141. +struct device *dev_get(const char *name)
  5142.  {
  5143.      struct device *dev;
  5144.  
  5145. diff -u --recursive --new-file v1.3.14/linux/net/ipv4/af_inet.c linux/net/ipv4/af_inet.c
  5146. --- v1.3.14/linux/net/ipv4/af_inet.c    Thu Jul 13 16:20:21 1995
  5147. +++ linux/net/ipv4/af_inet.c    Tue Aug  1 10:02:48 1995
  5148. @@ -1194,7 +1194,7 @@
  5149.      return(sk->prot->read(sk, (unsigned char *) ubuf, size, noblock, 0));
  5150.  }
  5151.  
  5152. -static int inet_send(struct socket *sock, void *ubuf, int size, int noblock, 
  5153. +static int inet_send(struct socket *sock, const void *ubuf, int size, int noblock, 
  5154.             unsigned flags)
  5155.  {
  5156.      struct sock *sk = (struct sock *) sock->data;
  5157. @@ -1208,15 +1208,15 @@
  5158.      /* We may need to bind the socket. */
  5159.      if(inet_autobind(sk)!=0)
  5160.          return(-EAGAIN);
  5161. -    return(sk->prot->write(sk, (unsigned char *) ubuf, size, noblock, flags));
  5162. +    return(sk->prot->write(sk, (const unsigned char *) ubuf, size, noblock, flags));
  5163.  }
  5164.  
  5165. -static int inet_write(struct socket *sock, char *ubuf, int size, int noblock)
  5166. +static int inet_write(struct socket *sock, const char *ubuf, int size, int noblock)
  5167.  {
  5168.      return inet_send(sock,ubuf,size,noblock,0);
  5169.  }
  5170.  
  5171. -static int inet_sendto(struct socket *sock, void *ubuf, int size, int noblock, 
  5172. +static int inet_sendto(struct socket *sock, const void *ubuf, int size, int noblock, 
  5173.          unsigned flags, struct sockaddr *sin, int addr_len)
  5174.  {
  5175.      struct sock *sk = (struct sock *) sock->data;
  5176. @@ -1232,7 +1232,7 @@
  5177.      /* We may need to bind the socket. */
  5178.      if(inet_autobind(sk)!=0)
  5179.          return -EAGAIN;
  5180. -    return(sk->prot->sendto(sk, (unsigned char *) ubuf, size, noblock, flags, 
  5181. +    return(sk->prot->sendto(sk, (const unsigned char *) ubuf, size, noblock, flags, 
  5182.                 (struct sockaddr_in *)sin, addr_len));
  5183.  }
  5184.  
  5185. diff -u --recursive --new-file v1.3.14/linux/net/ipv4/arp.c linux/net/ipv4/arp.c
  5186. --- v1.3.14/linux/net/ipv4/arp.c    Mon Jul 31 15:59:04 1995
  5187. +++ linux/net/ipv4/arp.c    Mon Jul 31 19:17:33 1995
  5188. @@ -25,7 +25,7 @@
  5189.   *        Alan Cox    :    Allow >4K in /proc
  5190.   *        Alan Cox    :    Make ARP add its own protocol entry
  5191.   *
  5192. - *              Ross Martin     :       Rewrote arp_rcv() and arp_get_info()
  5193. + *        Ross Martin     :       Rewrote arp_rcv() and arp_get_info()
  5194.   *        Stephen Henson    :    Add AX25 support to arp_get_info()
  5195.   *        Alan Cox    :    Drop data when a device is downed.
  5196.   *        Alan Cox    :    Use init_timer().
  5197. @@ -33,14 +33,26 @@
  5198.   *        Martin Seine    :    Move the arphdr structure
  5199.   *                    to if_arp.h for compatibility.
  5200.   *                    with BSD based programs.
  5201. - *              Andrew Tridgell :       Added ARP netmask code and
  5202. - *                                      re-arranged proxy handling.
  5203. + *        Andrew Tridgell :       Added ARP netmask code and
  5204. + *                    re-arranged proxy handling.
  5205.   *        Alan Cox    :    Changed to use notifiers.
  5206.   *        Niibe Yutaka    :    Reply for this device or proxies only.
  5207.   *        Alan Cox    :    Don't proxy across hardware types!
  5208.   *        Jonathan Naylor :    Added support for NET/ROM.
  5209. + *        Mike Shaver     :       RFC1122 checks.
  5210.   */
  5211.  
  5212. +/* RFC1122 Status:
  5213. +   2.3.2.1 (ARP Cache Validation):
  5214. +     MUST provide mechanism to flush stale cache entries (OK)
  5215. +     SHOULD be able to configure cache timeout (NOT YET)
  5216. +     MUST throttle ARP retransmits (OK)
  5217. +   2.3.2.2 (ARP Packet Queue):
  5218. +     SHOULD save at least one packet from each "conversation" with an
  5219. +       unresolved IP address.  (OK)
  5220. +   950727 -- MS
  5221. +*/
  5222. +      
  5223.  #include <linux/types.h>
  5224.  #include <linux/string.h>
  5225.  #include <linux/kernel.h>
  5226. @@ -112,6 +124,10 @@
  5227.   *    next request is send.
  5228.   */
  5229.  
  5230. +/* RFC1122: OK.  Throttles ARPing, as per 2.3.2.1. (MUST) */
  5231. +/* The recommended minimum timeout is 1 second per destination. */
  5232. +/* Is this a per-destination timeout? -- MS [YES AC]*/
  5233. +
  5234.  #define ARP_RES_TIME        (250*(HZ/10))
  5235.  
  5236.  /*
  5237. @@ -184,7 +200,7 @@
  5238.  
  5239.  /*
  5240.   *    The last bits in the IP address are used for the cache lookup.
  5241. - *      A special entry is used for proxy arp entries
  5242. + *    A special entry is used for proxy arp entries
  5243.   */
  5244.  
  5245.  #define HASH(paddr)         (htonl(paddr) & (ARP_TABLE_SIZE - 1))
  5246. @@ -198,6 +214,8 @@
  5247.   *    ARP_MAX_TRIES*ARP_RES_TIME.
  5248.   */
  5249.  
  5250. +/* RFC1122: Looks good.  Prevents stale ARP entries, as per 2.3.2.1. (MUST) */
  5251. +
  5252.  static void arp_check_expire(unsigned long dummy)
  5253.  {
  5254.      int i;
  5255. @@ -219,7 +237,9 @@
  5256.                  *pentry = entry->next;    /* remove from list */
  5257.                  arp_cache_stamp++;
  5258.                  del_timer(&entry->timer);    /* Paranoia */
  5259. -                kfree_s(entry, sizeof(struct arp_table));
  5260. +                kfree_s(entry, sizeof(struct arp_table)); 
  5261. +                /* Don't have to remove packets in entry->skb. */
  5262. +                /* See comments above. */
  5263.              }
  5264.              else
  5265.                  pentry = &entry->next;    /* go to next entry */
  5266. @@ -431,6 +451,11 @@
  5267.      /* proxy entries shouldn't really time out so this is really
  5268.         only here for completeness
  5269.      */
  5270. +
  5271. +    /* RFC1122: They *can* be timed out, according to 2.3.2.1. */
  5272. +    /* They recommend a minute. -- MS */
  5273. +    /* The world doesn't work this way -- AC */
  5274. +
  5275.      if (entry->flags & ATF_PUBL)
  5276.        pentry = &arp_tables[PROXY_HASH];
  5277.      else
  5278. @@ -453,6 +478,10 @@
  5279.      /*
  5280.       *    We should never arrive here.
  5281.       */
  5282. +
  5283. +    /* Should we perhaps flush the ARP table (except the ones we're */
  5284. +    /* publishing, if we can trust the queue that much) at this */
  5285. +    /* point? -- MS */
  5286.  }
  5287.  
  5288.  
  5289. @@ -474,6 +503,10 @@
  5290.      {
  5291.          printk("arp_send_q: incomplete entry for %s\n",
  5292.                  in_ntoa(entry->ip));
  5293. +        /* Can't flush the skb, because RFC1122 says to hang on to */
  5294. +        /* at least one from any unresolved entry.  --MS */
  5295. +        /* Whats happened is that someone has 'unresolved' the entry
  5296. +           as we got to use it - this 'can't happen' -- AC */
  5297.          return;
  5298.      }
  5299.  
  5300. @@ -580,6 +613,8 @@
  5301.      {
  5302.          kfree_skb(skb, FREE_READ);
  5303.          return 0;
  5304. +        /* Should this be an error/printk?  Seems like something */
  5305. +        /* you'd want to know about. Unless it's just !IFF_NOARP. -- MS */
  5306.      }
  5307.  
  5308.  /*
  5309. @@ -588,6 +623,8 @@
  5310.   *    match the protocol the device speaks.  If it doesn't, there is a
  5311.   *    problem, so toss the packet.
  5312.   */
  5313. +/* Again, should this be an error/printk? -- MS */
  5314. +
  5315.        switch(dev->type)
  5316.        {
  5317.  #ifdef CONFIG_AX25
  5318. @@ -681,6 +718,10 @@
  5319.  /* 
  5320.   *    Replies to other machines get tossed. 
  5321.   */
  5322. +
  5323. + /* Should we reset the expiry timers for an entry that isn't for us, if we */
  5324. + /* have it in the cache? RFC1122 suggests it. -- MS */
  5325. +
  5326.              kfree_skb(skb, FREE_READ);
  5327.              return 0;
  5328.          }
  5329. @@ -882,6 +923,7 @@
  5330.          case IS_MULTICAST:
  5331.              if(dev->type==ARPHRD_ETHER || dev->type==ARPHRD_IEEE802)
  5332.              {
  5333. +                /* What exactly does this do? -- MS */
  5334.                  haddr[0]=0x01;
  5335.                  haddr[1]=0x00;
  5336.                  haddr[2]=0x5e;
  5337. @@ -914,8 +956,8 @@
  5338.  
  5339.      if (entry != NULL)     /* It exists */
  5340.      {
  5341. -            if (!(entry->flags & ATF_COM))
  5342. -            {
  5343. +        if (!(entry->flags & ATF_COM))
  5344. +        {
  5345.              /*
  5346.               *    A request was already send, but no reply yet. Thus
  5347.               *    queue the packet with the previous attempt
  5348. @@ -954,7 +996,7 @@
  5349.          entry->last_used = jiffies;
  5350.          entry->flags = 0;
  5351.          entry->ip = paddr;
  5352. -            entry->mask = DEF_ARP_NETMASK;
  5353. +        entry->mask = DEF_ARP_NETMASK;
  5354.          memset(entry->ha, 0, dev->addr_len);
  5355.          entry->hlen = dev->addr_len;
  5356.          entry->htype = dev->type;
  5357. @@ -1072,15 +1114,15 @@
  5358.      *start=buffer+(offset-begin);    /* Start of wanted data */
  5359.      len-=(offset-begin);        /* Start slop */
  5360.      if(len>length)
  5361. -        len=length;                /* Ending slop */
  5362. +        len=length;            /* Ending slop */
  5363.      return len;
  5364.  }
  5365.  
  5366.  
  5367.  /*
  5368.   *    This will find an entry in the ARP table by looking at the IP address.
  5369. - *      If proxy is PROXY_EXACT then only exact IP matches will be allowed
  5370. - *      for proxy entries, otherwise the netmask will be used
  5371. + *    If proxy is PROXY_EXACT then only exact IP matches will be allowed
  5372. + *    for proxy entries, otherwise the netmask will be used
  5373.   */
  5374.  
  5375.  static struct arp_table *arp_lookup(u32 paddr, enum proxy proxy)
  5376. @@ -1095,7 +1137,7 @@
  5377.      if (!entry && proxy != PROXY_NONE)
  5378.      for (entry=arp_tables[PROXY_HASH]; entry != NULL; entry = entry->next)
  5379.        if ((proxy==PROXY_EXACT) ? (entry->ip==paddr)
  5380. -                               : !((entry->ip^paddr)&entry->mask)) 
  5381. +                   : !((entry->ip^paddr)&entry->mask)) 
  5382.          break;      
  5383.  
  5384.      return entry;
  5385. @@ -1249,7 +1291,7 @@
  5386.      
  5387.      if (entry == NULL)
  5388.      {
  5389. -            unsigned long hash = HASH(ip);
  5390. +        unsigned long hash = HASH(ip);
  5391.          if (r.arp_flags & ATF_PUBL)
  5392.            hash = PROXY_HASH;
  5393.  
  5394. diff -u --recursive --new-file v1.3.14/linux/net/ipv4/icmp.c linux/net/ipv4/icmp.c
  5395. --- v1.3.14/linux/net/ipv4/icmp.c    Thu Jul 13 16:20:21 1995
  5396. +++ linux/net/ipv4/icmp.c    Mon Jul 31 18:51:58 1995
  5397. @@ -34,6 +34,7 @@
  5398.   *        Alan Cox    :    Tightened even more.
  5399.   *        Arnt Gulbrandsen:    Misplaced #endif with net redirect and break
  5400.   *        A.N.Kuznetsov    :    ICMP timestamp still used skb+1
  5401. + *        Mike Shaver    :    RFC1122 checks.
  5402.   * 
  5403.   *
  5404.   *        This program is free software; you can redistribute it and/or
  5405. @@ -41,6 +42,69 @@
  5406.   *        as published by the Free Software Foundation; either version
  5407.   *        2 of the License, or (at your option) any later version.
  5408.   */
  5409. +
  5410. +/* RFC1122 Status: (boy, are there a lot of rules for ICMP)
  5411. +   3.2.2 (Generic ICMP stuff)
  5412. +     MUST discard messages of unknown type. (OK)
  5413. +     MUST copy at least the first 8 bytes from the offending packet
  5414. +       when sending ICMP errors. (OK)
  5415. +     MUST pass received ICMP errors up to protocol level. (OK)
  5416. +     SHOULD send ICMP errors with TOS == 0. (OK)
  5417. +     MUST NOT send ICMP errors in reply to:
  5418. +       ICMP errors (OK)
  5419. +       Broadcast/multicast datagrams (OK)
  5420. +       MAC broadcasts (OK)
  5421. +       Non-initial fragments (OK)
  5422. +       Datagram with a source address that isn't a single host. (OK)
  5423. +  3.2.2.1 (Destination Unreachable)
  5424. +    All the rules govern the IP layer, and are dealt with in ip.c, not here.
  5425. +  3.2.2.2 (Redirect)
  5426. +    Host SHOULD NOT send ICMP_REDIRECTs.  (OK)
  5427. +    MUST update routing table in response to host or network redirects. 
  5428. +      (host OK, network NOT YET) [Intentionally -- AC]
  5429. +    SHOULD drop redirects if they're not from directly connected gateway
  5430. +      (OK -- we drop it if it's not from our old gateway, which is close
  5431. +       enough)
  5432. +  3.2.2.3 (Source Quench)
  5433. +    MUST pass incoming SOURCE_QUENCHs to transport layer (OK)
  5434. +    Other requirements are dealt with at the transport layer.
  5435. +  3.2.2.4 (Time Exceeded)
  5436. +    MUST pass TIME_EXCEEDED to transport layer (OK)
  5437. +    Other requirements dealt with at IP (generating TIME_EXCEEDED).
  5438. +  3.2.2.5 (Parameter Problem)
  5439. +    SHOULD generate these, but it doesn't say for what.  So we're OK. =)
  5440. +    MUST pass received PARAMPROBLEM to transport layer (NOT YET)
  5441. +        [Solaris 2.X seems to assert EPROTO when this occurs] -- AC
  5442. +  3.2.2.6 (Echo Request/Reply)
  5443. +    MUST reply to ECHO_REQUEST, and give app to do ECHO stuff (OK, OK)
  5444. +    MAY discard broadcast ECHO_REQUESTs. (We don't, but that's OK.)
  5445. +    MUST reply using same source address as the request was sent to.
  5446. +      We're OK for unicast ECHOs, and it doesn't say anything about
  5447. +      how to handle broadcast ones, since it's optional.
  5448. +    MUST copy data from REQUEST to REPLY (OK)
  5449. +      unless it would require illegal fragmentation (MUST) (NOT YET)
  5450. +    MUST pass REPLYs to transport/user layer (OK)
  5451. +    MUST use any provided source route (reversed) for REPLY. (NOT YET)
  5452. + 3.2.2.7 (Information Request/Reply)
  5453. +   MUST NOT implement this. (I guess that means silently discard...?) (OK)
  5454. + 3.2.2.8 (Timestamp Request/Reply)
  5455. +   MAY implement (OK)
  5456. +   SHOULD be in-kernel for "minimum variability" (OK)
  5457. +   MAY discard broadcast REQUESTs.  (OK, but see source for inconsistency)
  5458. +   MUST reply using same source address as the request was sent to. (OK)
  5459. +   MUST reverse source route, as per ECHO (NOT YET)
  5460. +   MUST pass REPLYs to transport/user layer (requires RAW, just like ECHO) (OK)
  5461. +   MUST update clock for timestamp at least 15 times/sec (OK)
  5462. +   MUST be "correct within a few minutes" (OK)
  5463. + 3.2.2.9 (Address Mask Request/Reply)
  5464. +   MAY implement (OK)
  5465. +   MUST send a broadcast REQUEST if using this system to set netmask
  5466. +     (OK... we don't use it)
  5467. +   MUST discard received REPLYs if not using this system (OK)
  5468. +   MUST NOT send replies unless specifically made agent for this sort
  5469. +     of thing. (NOT YET)
  5470. +*/
  5471. +
  5472.  #include <linux/types.h>
  5473.  #include <linux/sched.h>
  5474.  #include <linux/kernel.h>
  5475. @@ -180,6 +244,9 @@
  5476.              icmp_statistics.IcmpOutSrcQuenchs++;
  5477.              break;
  5478.          case ICMP_REDIRECT:
  5479. +        /* RFC1122: (3.2.2.2) Sorta bad.  SHOULDN'T send */
  5480. +        /* ICMP_REDIRECTs unless we're a gateway. -- MS */
  5481. +        /* We don't .. this path isnt invoked -- AC */
  5482.              icmp_statistics.IcmpOutRedirects++;
  5483.              break;
  5484.          case ICMP_ECHO:
  5485. @@ -227,6 +294,11 @@
  5486.       */
  5487.  
  5488.      our_addr = dev->pa_addr;
  5489. +
  5490. +    /* RFC1122: (3.2.2).  MUST NOT send ICMP in reply to */
  5491. +    /* packet with a source IP address that doesn't define a single */
  5492. +    /* host. -- MS.  Checked higher up -- AC */
  5493. +
  5494.      if (iph->daddr != our_addr && ip_chk_addr(iph->daddr) == IS_MYADDR)
  5495.          our_addr = iph->daddr;
  5496.      offset = ip_build_header(skb, our_addr, iph->saddr,
  5497. @@ -250,6 +322,9 @@
  5498.       *    Fill in the frame
  5499.       */
  5500.       
  5501. +    /* RFC1122: SHOULD send with TOS == 0, and I guess this does. */
  5502. +    /* Perhaps it should be explicit? -- MS */
  5503. +
  5504.      icmph = (struct icmphdr *) (skb->data + offset);
  5505.      icmph->type = type;
  5506.      icmph->code = code;
  5507. @@ -257,6 +332,9 @@
  5508.      icmph->un.gateway = info;    /* This might not be meant for 
  5509.                         this form of the union but it will
  5510.                         be right anyway */
  5511. +
  5512. +    /* RFC1122: OK. Copies the minimum 8 bytes unchanged from the offending */
  5513. +    /* packet (MUST) as per 3.2.2. -- MS */
  5514.      memcpy(icmph + 1, iph, sizeof(struct iphdr) + 8);
  5515.  
  5516.      icmph->checksum = ip_compute_csum((unsigned char *)icmph,
  5517. @@ -332,6 +410,10 @@
  5518.          /* 
  5519.           *    Pass it off to everyone who wants it. 
  5520.           */
  5521. +
  5522. +        /* RFC1122: OK. Passes appropriate ICMP errors to the */
  5523. +        /* appropriate protocol layer (MUST), as per 3.2.2. */
  5524. +
  5525.          if (iph->protocol == ipprot->protocol && ipprot->err_handler) 
  5526.          {
  5527.              ipprot->err_handler(err, (unsigned char *)(icmph + 1),
  5528. @@ -469,6 +551,12 @@
  5529.       */
  5530.      icmphr = (struct icmphdr *) (skb2->data + offset);
  5531.      memcpy((char *) icmphr, (char *) icmph, len);
  5532. +
  5533. +    /* Are we copying the data from the ECHO datagram? */
  5534. +    /* We're supposed to, and it looks like we are. -- MS */
  5535. +    /* We're also supposed to truncate it if it would force */
  5536. +    /* illegal fragmentation. *sigh*  */
  5537. +
  5538.      icmphr->type = ICMP_ECHOREPLY;
  5539.      icmphr->code = 0;
  5540.      icmphr->checksum = 0;
  5541. @@ -587,11 +675,20 @@
  5542.  /* 
  5543.   *    Handle ICMP_ADDRESS_MASK requests. 
  5544.   */
  5545. +
  5546. +/* RFC1122 (3.2.2.9).  A host MUST only send replies to */
  5547. +/* ADDRESS_MASK requests if it's been configured as an address mask */
  5548. +/* agent.  Receiving a request doesn't constitute implicit permission to */
  5549. +/* act as one. Of course, implementing this correctly requires (SHOULD) */
  5550. +/* a way to turn the functionality on and off.  Another one for sysctl(), */
  5551. +/* I guess. -- MS */
  5552. +/* Botched with a CONFIG option for now - Linus add scts sysctl please.. */
  5553.   
  5554.  static void icmp_address(struct icmphdr *icmph, struct sk_buff *skb, struct device *dev,
  5555.        unsigned long saddr, unsigned long daddr, int len,
  5556.        struct options *opt)
  5557.  {
  5558. +#ifdef CONFIG_IP_ADDR_AGENT
  5559.      struct icmphdr *icmphr;
  5560.      struct sk_buff *skb2;
  5561.      int size, offset;
  5562. @@ -647,7 +744,7 @@
  5563.  
  5564.      /* Ship it out - free it when done */
  5565.      ip_queue_xmit((struct sock *)NULL, ndev, skb2, 1);
  5566. -
  5567. +#endif
  5568.      skb->sk = NULL;
  5569.      kfree_skb(skb, FREE_READ);
  5570.  }
  5571. @@ -699,6 +796,11 @@
  5572.      if (ip_chk_addr(daddr) != IS_MYADDR)
  5573.      {
  5574.          if (icmph->type != ICMP_ECHO) 
  5575. +        /* RFC1122: We're allowed to reply to ICMP_TIMESTAMP */
  5576. +        /* requests in the same manner as ICMP_ECHO (optionally */
  5577. +        /* drop those to a bcast/mcast), so perhaps we should be */
  5578. +        /* consistent? -- MS */
  5579. +
  5580.          {
  5581.              icmp_statistics.IcmpInErrors++;
  5582.              kfree_skb(skb1, FREE_READ);
  5583. @@ -738,6 +840,9 @@
  5584.              icmp_timestamp(icmph, skb1, dev, saddr, daddr, len, opt);
  5585.              return 0;
  5586.          case ICMP_TIMESTAMPREPLY:
  5587. +        /* RFC1122: MUST pass TIMESTAMPREPLY messages up to app layer, */
  5588. +        /* just as with ECHOREPLY.  You have to use raw to get that */
  5589. +        /* functionality, just as with ECHOREPLY. Close enough. -- MS */
  5590.              icmp_statistics.IcmpInTimestampReps++;
  5591.              kfree_skb(skb1,FREE_READ);
  5592.              return 0;
  5593. @@ -762,6 +867,8 @@
  5594.              kfree_skb(skb1, FREE_READ);
  5595.              return(0);
  5596.          default:
  5597. +            /* RFC1122: OK.  Silently discarding weird ICMP (MUST), */
  5598. +            /* as per 3.2.2. -- MS */
  5599.              icmp_statistics.IcmpInErrors++;
  5600.              kfree_skb(skb1, FREE_READ);
  5601.              return(0);
  5602. diff -u --recursive --new-file v1.3.14/linux/net/ipv4/ip.c linux/net/ipv4/ip.c
  5603. --- v1.3.14/linux/net/ipv4/ip.c    Mon Jul 31 15:59:04 1995
  5604. +++ linux/net/ipv4/ip.c    Tue Aug  1 10:02:49 1995
  5605. @@ -2346,12 +2346,12 @@
  5606.   */
  5607.  
  5608.  int ip_build_xmit(struct sock *sk,
  5609. -           void getfrag (void *,
  5610. +           void getfrag (const void *,
  5611.                   int,
  5612.                   char *,
  5613.                   unsigned int,
  5614.                   unsigned int),
  5615. -           void *frag,
  5616. +           const void *frag,
  5617.             unsigned short int length,
  5618.             int daddr,
  5619.             int flags,
  5620. diff -u --recursive --new-file v1.3.14/linux/net/ipv4/ip_fw.c linux/net/ipv4/ip_fw.c
  5621. --- v1.3.14/linux/net/ipv4/ip_fw.c    Mon Jul 31 15:59:04 1995
  5622. +++ linux/net/ipv4/ip_fw.c    Tue Aug  1 10:02:49 1995
  5623. @@ -128,7 +128,7 @@
  5624.   */
  5625.  
  5626.  static unsigned short masq_port = PORT_MASQ_BEGIN;
  5627. -static char *strProt[] = {"UDP","TCP"};
  5628. +static const char *strProt[] = {"UDP","TCP"};
  5629.  struct ip_masq *ip_msq_hosts;
  5630.  
  5631.  #endif
  5632. diff -u --recursive --new-file v1.3.14/linux/net/ipv4/packet.c linux/net/ipv4/packet.c
  5633. --- v1.3.14/linux/net/ipv4/packet.c    Fri Jul  7 08:54:57 1995
  5634. +++ linux/net/ipv4/packet.c    Tue Aug  1 10:02:49 1995
  5635. @@ -141,7 +141,7 @@
  5636.   *    protocol layers and you must therefore supply it with a complete frame
  5637.   */
  5638.   
  5639. -static int packet_sendto(struct sock *sk, unsigned char *from, int len,
  5640. +static int packet_sendto(struct sock *sk, const unsigned char *from, int len,
  5641.            int noblock, unsigned flags, struct sockaddr_in *usin,
  5642.            int addr_len)
  5643.  {
  5644. @@ -224,7 +224,7 @@
  5645.   *    always fail but we include it for completeness and future expansion.
  5646.   */
  5647.  
  5648. -static int packet_write(struct sock *sk, unsigned char *buff, 
  5649. +static int packet_write(struct sock *sk, const unsigned char *buff, 
  5650.           int len, int noblock,  unsigned flags)
  5651.  {
  5652.      return(packet_sendto(sk, buff, len, noblock, flags, NULL, 0));
  5653. diff -u --recursive --new-file v1.3.14/linux/net/ipv4/raw.c linux/net/ipv4/raw.c
  5654. --- v1.3.14/linux/net/ipv4/raw.c    Fri Jun 30 16:22:32 1995
  5655. +++ linux/net/ipv4/raw.c    Tue Aug  1 10:02:49 1995
  5656. @@ -127,18 +127,18 @@
  5657.   *    Callback support is trivial for SOCK_RAW
  5658.   */
  5659.    
  5660. -static void raw_getfrag(void *p, int saddr, char *to, unsigned int offset, unsigned int fraglen)
  5661. +static void raw_getfrag(const void *p, int saddr, char *to, unsigned int offset, unsigned int fraglen)
  5662.  {
  5663. -    memcpy_fromfs(to, (unsigned char *)p+offset, fraglen);
  5664. +    memcpy_fromfs(to, (const unsigned char *)p+offset, fraglen);
  5665.  }
  5666.  
  5667.  /*
  5668.   *    IPPROTO_RAW needs extra work.
  5669.   */
  5670.   
  5671. -static void raw_getrawfrag(void *p, int saddr, char *to, unsigned int offset, unsigned int fraglen)
  5672. +static void raw_getrawfrag(const void *p, int saddr, char *to, unsigned int offset, unsigned int fraglen)
  5673.  {
  5674. -    memcpy_fromfs(to, (unsigned char *)p+offset, fraglen);
  5675. +    memcpy_fromfs(to, (const unsigned char *)p+offset, fraglen);
  5676.      if(offset==0)
  5677.      {
  5678.          struct iphdr *iph=(struct iphdr *)to;
  5679. @@ -155,7 +155,7 @@
  5680.      }
  5681.  }
  5682.  
  5683. -static int raw_sendto(struct sock *sk, unsigned char *from, 
  5684. +static int raw_sendto(struct sock *sk, const unsigned char *from, 
  5685.      int len, int noblock, unsigned flags, struct sockaddr_in *usin, int addr_len)
  5686.  {
  5687.      int err;
  5688. @@ -207,7 +207,7 @@
  5689.  }
  5690.  
  5691.  
  5692. -static int raw_write(struct sock *sk, unsigned char *buff, int len, int noblock,
  5693. +static int raw_write(struct sock *sk, const unsigned char *buff, int len, int noblock,
  5694.         unsigned flags)
  5695.  {
  5696.      return(raw_sendto(sk, buff, len, noblock, flags, NULL, 0));
  5697. diff -u --recursive --new-file v1.3.14/linux/net/ipv4/tcp.c linux/net/ipv4/tcp.c
  5698. --- v1.3.14/linux/net/ipv4/tcp.c    Mon Jul 31 15:59:04 1995
  5699. +++ linux/net/ipv4/tcp.c    Tue Aug  1 10:02:49 1995
  5700. @@ -336,7 +336,7 @@
  5701.   *    of two things. Firstly we will bin packets even within the window
  5702.   *    in order to get the data we are waiting for into the memory limit.
  5703.   *    Secondly we bin common duplicate forms at receive time
  5704. - *      Better heuristics welcome
  5705. + *    Better heuristics welcome
  5706.   */
  5707.     
  5708.  int tcp_select_window(struct sock *sk)
  5709. @@ -1456,7 +1456,7 @@
  5710.   *    and starts the transmit system.
  5711.   */
  5712.  
  5713. -static int tcp_write(struct sock *sk, unsigned char *from,
  5714. +static int tcp_write(struct sock *sk, const unsigned char *from,
  5715.        int len, int nonblock, unsigned flags)
  5716.  {
  5717.      int copied = 0;
  5718. @@ -1576,11 +1576,11 @@
  5719.  
  5720.          if ((skb = tcp_dequeue_partial(sk)) != NULL) 
  5721.          {
  5722. -                int hdrlen;
  5723. +            int hdrlen;
  5724.  
  5725. -                 /* IP header + TCP header */
  5726. +             /* IP header + TCP header */
  5727.              hdrlen = ((unsigned long)skb->h.th - (unsigned long)skb->data)
  5728. -                     + sizeof(struct tcphdr);
  5729. +                 + sizeof(struct tcphdr);
  5730.      
  5731.              /* Add more stuff to the end of skb->len */
  5732.              if (!(flags & MSG_OOB)) 
  5733. @@ -1777,7 +1777,7 @@
  5734.   *    This is just a wrapper. 
  5735.   */
  5736.  
  5737. -static int tcp_sendto(struct sock *sk, unsigned char *from,
  5738. +static int tcp_sendto(struct sock *sk, const unsigned char *from,
  5739.         int len, int nonblock, unsigned flags,
  5740.         struct sockaddr_in *addr, int addr_len)
  5741.  {
  5742. @@ -2586,10 +2586,10 @@
  5743.  
  5744.  /*
  5745.   *    Look for tcp options. Parses everything but only knows about MSS.
  5746. - *      This routine is always called with the packet containing the SYN.
  5747. - *      However it may also be called with the ack to the SYN.  So you
  5748. - *      can't assume this is always the SYN.  It's always called after
  5749. - *      we have set up sk->mtu to our own MTU.
  5750. + *    This routine is always called with the packet containing the SYN.
  5751. + *    However it may also be called with the ack to the SYN.  So you
  5752. + *    can't assume this is always the SYN.  It's always called after
  5753. + *    we have set up sk->mtu to our own MTU.
  5754.   *
  5755.   *    We need at minimum to add PAWS support here. Possibly large windows
  5756.   *    as Linux gets deployed on 100Mb/sec networks.
  5757. @@ -3452,7 +3452,7 @@
  5758.                  sk->backoff = 0;
  5759.              }
  5760.              flag |= (2|4);    /* 2 is really more like 'don't adjust the rtt 
  5761. -                               In this case as we just set it up */
  5762. +                       In this case as we just set it up */
  5763.              cli();
  5764.              oskb = sk->send_head;
  5765.              IS_SKB(oskb);
  5766. @@ -3495,7 +3495,7 @@
  5767.      if (skb_peek(&sk->write_queue) != NULL) 
  5768.      {
  5769.          if (after (sk->window_seq+1, sk->write_queue.next->h.seq) &&
  5770. -                (sk->retransmits == 0 || 
  5771. +            (sk->retransmits == 0 || 
  5772.               sk->ip_xmit_timeout != TIME_WRITE ||
  5773.               before(sk->write_queue.next->h.seq, sk->rcv_ack_seq + 1))
  5774.              && sk->packets_out < sk->cong_window) 
  5775. @@ -3514,7 +3514,7 @@
  5776.               /*
  5777.                *    Data to queue but no room.
  5778.                */
  5779. -                 reset_xmit_timer(sk, TIME_PROBE0, sk->rto);
  5780. +             reset_xmit_timer(sk, TIME_PROBE0, sk->rto);
  5781.           }        
  5782.      }
  5783.      else
  5784. diff -u --recursive --new-file v1.3.14/linux/net/ipv4/udp.c linux/net/ipv4/udp.c
  5785. --- v1.3.14/linux/net/ipv4/udp.c    Tue Jul 18 16:29:00 1995
  5786. +++ linux/net/ipv4/udp.c    Tue Aug  1 10:02:49 1995
  5787. @@ -46,6 +46,7 @@
  5788.   *        Alan Cox    :    Cache last socket
  5789.   *        Alan Cox    :    Route cache
  5790.   *        Jon Peatfield    :    Minor efficientcy fix to sendto().
  5791. + *        Mike Shaver    :    RFC1122 checks.
  5792.   *
  5793.   *
  5794.   *        This program is free software; you can redistribute it and/or
  5795. @@ -54,6 +55,32 @@
  5796.   *        2 of the License, or (at your option) any later version.
  5797.   */
  5798.   
  5799. +/* RFC1122 Status:
  5800. +   4.1.3.1 (Ports):
  5801. +     SHOULD send ICMP_PORT_UNREACHABLE in reponse to datagrams to 
  5802. +       an un-listened port. (OK)
  5803. +   4.1.3.2 (IP Options)
  5804. +     MUST pass IP options from IP -> application (OK)
  5805. +     MUST allow application to specify IP options (OK)
  5806. +   4.1.3.3 (ICMP Messages)
  5807. +     MUST pass ICMP error messages to application (OK)
  5808. +   4.1.3.4 (UDP Checksums)
  5809. +     MUST provide facility for checksumming (OK)
  5810. +     MAY allow application to control checksumming (OK)
  5811. +     MUST default to checksumming on (OK)
  5812. +     MUST discard silently datagrams with bad csums (OK)
  5813. +   4.1.3.5 (UDP Multihoming)
  5814. +     MUST allow application to specify source address (OK)
  5815. +     SHOULD be able to communicate the chosen src addr up to application
  5816. +       when application doesn't choose (NOT YET - doesnt seem to be in the BSD API)
  5817. +       [Does opening a SOCK_PACKET and snooping your output count 8)]
  5818. +   4.1.3.6 (Invalid Addresses)
  5819. +     MUST discard invalid source addresses (NOT YET -- will be implemented
  5820. +       in IP, so UDP will eventually be OK.  Right now it's a violation.)
  5821. +     MUST only send datagrams with one of our addresses (NOT YET - ought to be OK )
  5822. +   950728 -- MS
  5823. +*/
  5824. +
  5825.  #include <asm/system.h>
  5826.  #include <asm/segment.h>
  5827.  #include <linux/types.h>
  5828. @@ -81,7 +108,7 @@
  5829.  #include <net/checksum.h>
  5830.  
  5831.  /*
  5832. - *    SNMP MIB for the UDP layer
  5833. + *    Snmp MIB for the UDP layer
  5834.   */
  5835.  
  5836.  struct udp_mib        udp_statistics;
  5837. @@ -158,6 +185,10 @@
  5838.       *    client code people.
  5839.       */
  5840.       
  5841. +    /* RFC1122: OK.  Passes ICMP errors back to application, as per */
  5842. +    /* 4.1.3.3. */
  5843. +    /* After the comment above, that should be no surprise. */
  5844. +
  5845.      if (icmp_err_convert[err & 0xff].fatal)
  5846.      {
  5847.          sk->err = icmp_err_convert[err & 0xff].errno;
  5848. @@ -176,7 +207,7 @@
  5849.      struct udphdr uh;
  5850.      int daddr;
  5851.      int other;
  5852. -    char *from;
  5853. +    const char *from;
  5854.      int wcheck;
  5855.  };
  5856.  
  5857. @@ -186,10 +217,11 @@
  5858.   *    for direct user->board I/O transfers. That one will be fun.
  5859.   */
  5860.   
  5861. -static void udp_getfrag(void *p, int saddr, char * to, unsigned int offset, unsigned int fraglen) 
  5862. +static void udp_getfrag(const void *p, int saddr, char * to, unsigned int offset, unsigned int fraglen) 
  5863.  {
  5864.      struct udpfakehdr *ufh = (struct udpfakehdr *)p;
  5865. -    char *src, *dst;
  5866. +    const char *src;
  5867. +    char *dst;
  5868.      unsigned int len;
  5869.  
  5870.      if (offset) 
  5871. @@ -225,10 +257,11 @@
  5872.   *    this is a valid decision.
  5873.   */
  5874.   
  5875. -static void udp_getfrag_nosum(void *p, int saddr, char * to, unsigned int offset, unsigned int fraglen) 
  5876. +static void udp_getfrag_nosum(const void *p, int saddr, char * to, unsigned int offset, unsigned int fraglen) 
  5877.  {
  5878.      struct udpfakehdr *ufh = (struct udpfakehdr *)p;
  5879. -    char *src, *dst;
  5880. +    const char *src;
  5881. +    char *dst;
  5882.      unsigned int len;
  5883.  
  5884.      if (offset) 
  5885. @@ -254,7 +287,7 @@
  5886.   */
  5887.   
  5888.  static int udp_send(struct sock *sk, struct sockaddr_in *sin,
  5889. -              unsigned char *from, int len, int rt) 
  5890. +              const unsigned char *from, int len, int rt) 
  5891.  {
  5892.      int ulen = len + sizeof(struct udphdr);
  5893.      int a;
  5894. @@ -268,6 +301,17 @@
  5895.      ufh.other = (htons(ulen) << 16) + IPPROTO_UDP*256;
  5896.      ufh.from = from;
  5897.      ufh.wcheck = 0;
  5898. +
  5899. +    /* RFC1122 Violation: there is no provision for passing IP options */
  5900. +    /* from the application layer to the IP one.  It's a MUST (4.1.3.2), */
  5901. +    /* but it looks like it'd require some work on ip_build_xmit. */
  5902. +    /* Alan says he's got a Cunning Plan. -- MS */
  5903. +
  5904. +    /* RFC1122: OK.  Provides the checksumming facility (MUST) as per */
  5905. +    /* 4.1.3.4. It's configurable by the application via setsockopt() */
  5906. +    /* (MAY) and it defaults to on (MUST).  Almost makes up for the */
  5907. +    /* violation above. -- MS */
  5908. +
  5909.      if(sk->no_check)
  5910.          a = ip_build_xmit(sk, udp_getfrag_nosum, &ufh, ulen, 
  5911.              sin->sin_addr.s_addr, rt, IPPROTO_UDP);
  5912. @@ -281,7 +325,7 @@
  5913.  }
  5914.  
  5915.  
  5916. -static int udp_sendto(struct sock *sk, unsigned char *from, int len, int noblock,
  5917. +static int udp_sendto(struct sock *sk, const unsigned char *from, int len, int noblock,
  5918.         unsigned flags, struct sockaddr_in *usin, int addr_len)
  5919.  {
  5920.      struct sockaddr_in sin;
  5921. @@ -320,6 +364,16 @@
  5922.         *    broadcasting of data.
  5923.         */
  5924.         
  5925. +    /* RFC1122: OK.  Allows the application to select the specific */
  5926. +    /* source address for an outgoing packet (MUST) as per 4.1.3.5. */
  5927. +    /* Optional addition: a mechanism for telling the application what */
  5928. +    /* address was used. (4.1.3.5, MAY) -- MS */
  5929. +
  5930. +    /* RFC1122: MUST ensure that all outgoing packets have one */
  5931. +    /* of this host's addresses as a source addr.(4.1.3.6) - bind in  */
  5932. +    /* af_inet.c checks these. It does need work to allow BSD style */
  5933. +    /* bind to multicast as is done by xntpd        */
  5934. +
  5935.        if(usin->sin_addr.s_addr==INADDR_ANY)
  5936.            usin->sin_addr.s_addr=ip_my_addr();
  5937.            
  5938. @@ -340,7 +394,7 @@
  5939.   *    In BSD SOCK_DGRAM a write is just like a send.
  5940.   */
  5941.  
  5942. -static int udp_write(struct sock *sk, unsigned char *buff, int len, int noblock,
  5943. +static int udp_write(struct sock *sk, const unsigned char *buff, int len, int noblock,
  5944.        unsigned flags)
  5945.  {
  5946.      return(udp_sendto(sk, buff, len, noblock, flags, NULL, 0));
  5947. @@ -545,6 +599,13 @@
  5948.          return(0);
  5949.      }
  5950.  
  5951. +    /* RFC1122 warning: According to 4.1.3.6, we MUST discard any */
  5952. +    /* datagram which has an invalid source address, either here or */
  5953. +    /* in IP. */
  5954. +    /* Right now, IP isn't doing it, and neither is UDP. It's on the */
  5955. +    /* FIXME list for IP, though, so I wouldn't worry about it. */
  5956. +    /* (That's the Right Place to do it, IMHO.) -- MS */
  5957. +
  5958.      if (uh->check && (
  5959.          ( skb->ip_summed && udp_check(uh, len, saddr, daddr, skb->csum ) ) ||
  5960.          ( !skb->ip_summed && udp_check(uh, len, saddr, daddr,csum_partial((char*)uh, len, 0)))
  5961. @@ -553,6 +614,10 @@
  5962.      {
  5963.          /* <mea@utu.fi> wants to know, who sent it, to
  5964.             go and stomp on the garbage sender... */
  5965. +
  5966. +      /* RFC1122: OK.  Discards the bad packet silently (as far as */
  5967. +      /* the network is concered, anyway) as per 4.1.3.4 (MUST). */
  5968. +
  5969.          NETDEBUG(printk("UDP: bad checksum. From %08lX:%d to %08lX:%d ulen %d\n",
  5970.                 ntohl(saddr),ntohs(uh->source),
  5971.                 ntohl(daddr),ntohs(uh->dest),
  5972. @@ -644,6 +709,9 @@
  5973.       *    Charge it to the socket, dropping if the queue is full.
  5974.       */
  5975.  
  5976. +    /* I assume this includes the IP options, as per RFC1122 (4.1.3.2). */
  5977. +    /* If not, please let me know. -- MS */
  5978. +
  5979.      if (sock_queue_rcv_skb(sk,skb)<0) 
  5980.      {
  5981.          udp_statistics.UdpInErrors++;
  5982. @@ -692,4 +760,3 @@
  5983.      0, 0,
  5984.      {NULL,}
  5985.  };
  5986. -
  5987. diff -u --recursive --new-file v1.3.14/linux/net/ipv4/utils.c linux/net/ipv4/utils.c
  5988. --- v1.3.14/linux/net/ipv4/utils.c    Tue Jun  6 12:16:44 1995
  5989. +++ linux/net/ipv4/utils.c    Tue Aug  1 10:02:49 1995
  5990. @@ -62,7 +62,7 @@
  5991.   *    Convert an ASCII string to binary IP. 
  5992.   */
  5993.   
  5994. -unsigned long in_aton(char *str)
  5995. +unsigned long in_aton(const char *str)
  5996.  {
  5997.      unsigned long l;
  5998.      unsigned int val;
  5999. diff -u --recursive --new-file v1.3.14/linux/net/ipx/af_ipx.c linux/net/ipx/af_ipx.c
  6000. --- v1.3.14/linux/net/ipx/af_ipx.c    Mon Jul 31 15:59:05 1995
  6001. +++ linux/net/ipx/af_ipx.c    Tue Aug  1 10:02:49 1995
  6002. @@ -553,8 +553,8 @@
  6003.      return ipxrtr_add_route(intrfc->if_netnum, intrfc, NULL);
  6004.  }
  6005.  
  6006. -static char * ipx_frame_name(unsigned short);
  6007. -static char * ipx_device_name(ipx_interface *);
  6008. +static const char * ipx_frame_name(unsigned short);
  6009. +static const char * ipx_device_name(ipx_interface *);
  6010.  static int ipxrtr_route_skb(struct sk_buff *);
  6011.  
  6012.  static int 
  6013. @@ -986,7 +986,7 @@
  6014.  }
  6015.  
  6016.  static int
  6017. -ipxrtr_route_packet(ipx_socket *sk, struct sockaddr_ipx *usipx, void *ubuf, int len)
  6018. +ipxrtr_route_packet(ipx_socket *sk, struct sockaddr_ipx *usipx, const void *ubuf, int len)
  6019.  {
  6020.      struct sk_buff *skb;
  6021.      ipx_interface *intrfc;
  6022. @@ -1103,7 +1103,7 @@
  6023.      }
  6024.  }
  6025.  
  6026. -static char *
  6027. +static const char *
  6028.  ipx_frame_name(unsigned short frame)
  6029.  {
  6030.      switch (ntohs(frame)) {
  6031. @@ -1115,7 +1115,7 @@
  6032.      }
  6033.  }
  6034.  
  6035. -static char *
  6036. +static const char *
  6037.  ipx_device_name(ipx_interface *intrfc)
  6038.  {
  6039.      return (intrfc->if_internal ? "Internal" :
  6040. @@ -1687,7 +1687,7 @@
  6041.      return ipxitf_rcv(intrfc, skb);
  6042.  }
  6043.  
  6044. -static int ipx_sendto(struct socket *sock, void *ubuf, int len, int noblock,
  6045. +static int ipx_sendto(struct socket *sock, const void *ubuf, int len, int noblock,
  6046.      unsigned flags, struct sockaddr *usip, int addr_len)
  6047.  {
  6048.      ipx_socket *sk=(ipx_socket *)sock->data;
  6049. @@ -1730,7 +1730,7 @@
  6050.      return len;
  6051.  }
  6052.  
  6053. -static int ipx_send(struct socket *sock, void *ubuf, int size, int noblock, unsigned flags)
  6054. +static int ipx_send(struct socket *sock, const void *ubuf, int size, int noblock, unsigned flags)
  6055.  {
  6056.      return ipx_sendto(sock,ubuf,size,noblock,flags,NULL,0);
  6057.  }
  6058. @@ -1780,7 +1780,7 @@
  6059.      return(truesize);
  6060.  }        
  6061.  
  6062. -static int ipx_write(struct socket *sock, char *ubuf, int size, int noblock)
  6063. +static int ipx_write(struct socket *sock, const char *ubuf, int size, int noblock)
  6064.  {
  6065.      return ipx_send(sock,ubuf,size,noblock,0);
  6066.  }
  6067. diff -u --recursive --new-file v1.3.14/linux/net/netrom/af_netrom.c linux/net/netrom/af_netrom.c
  6068. --- v1.3.14/linux/net/netrom/af_netrom.c    Mon Jul 31 15:59:05 1995
  6069. +++ linux/net/netrom/af_netrom.c    Tue Aug  1 10:02:50 1995
  6070. @@ -1006,7 +1006,7 @@
  6071.      return 1;
  6072.  }
  6073.  
  6074. -static int nr_sendto(struct socket *sock, void *ubuf, int len, int noblock,
  6075. +static int nr_sendto(struct socket *sock, const void *ubuf, int len, int noblock,
  6076.      unsigned flags, struct sockaddr *usip, int addr_len)
  6077.  {
  6078.      struct sock *sk = (struct sock *)sock->data;
  6079. @@ -1112,12 +1112,12 @@
  6080.      return len;
  6081.  }
  6082.  
  6083. -static int nr_send(struct socket *sock, void *ubuf, int size, int noblock, unsigned flags)
  6084. +static int nr_send(struct socket *sock, const void *ubuf, int size, int noblock, unsigned flags)
  6085.  {
  6086.      return nr_sendto(sock, ubuf, size, noblock, flags, NULL, 0);
  6087.  }
  6088.  
  6089. -static int nr_write(struct socket *sock, char *ubuf, int size, int noblock)
  6090. +static int nr_write(struct socket *sock, const char *ubuf, int size, int noblock)
  6091.  {
  6092.      return nr_send(sock, ubuf, size, noblock, 0);
  6093.  }
  6094. @@ -1288,7 +1288,7 @@
  6095.  {
  6096.      struct sock *s;
  6097.      struct device *dev;
  6098. -    char *devname;
  6099. +    const char *devname;
  6100.      int len = 0;
  6101.      off_t pos = 0;
  6102.      off_t begin = 0;
  6103. diff -u --recursive --new-file v1.3.14/linux/net/netrom/nr_route.c linux/net/netrom/nr_route.c
  6104. --- v1.3.14/linux/net/netrom/nr_route.c    Mon Jul 31 15:59:05 1995
  6105. +++ linux/net/netrom/nr_route.c    Tue Aug  1 10:02:50 1995
  6106. @@ -62,7 +62,7 @@
  6107.   *    Add a new route to a node, and in the process add the node and the
  6108.   *    neighbour if it is new.
  6109.   */
  6110. -static int nr_add_node(ax25_address *nr, char *mnemonic, ax25_address *ax25,
  6111. +static int nr_add_node(ax25_address *nr, const char *mnemonic, ax25_address *ax25,
  6112.      ax25_digi *ax25_digi, struct device *dev, int quality, int obs_count)
  6113.  {
  6114.      struct nr_node  *nr_node;
  6115. diff -u --recursive --new-file v1.3.14/linux/net/socket.c linux/net/socket.c
  6116. --- v1.3.14/linux/net/socket.c    Fri Jun 30 16:22:34 1995
  6117. +++ linux/net/socket.c    Tue Aug  1 10:02:50 1995
  6118. @@ -69,7 +69,7 @@
  6119.                int whence);
  6120.  static int sock_read(struct inode *inode, struct file *file, char *buf,
  6121.               int size);
  6122. -static int sock_write(struct inode *inode, struct file *file, char *buf,
  6123. +static int sock_write(struct inode *inode, struct file *file, const char *buf,
  6124.                int size);
  6125.  
  6126.  static void sock_close(struct inode *inode, struct file *file);
  6127. @@ -337,7 +337,7 @@
  6128.   *    readable by the user process.
  6129.   */
  6130.  
  6131. -static int sock_write(struct inode *inode, struct file *file, char *ubuf, int size)
  6132. +static int sock_write(struct inode *inode, struct file *file, const char *ubuf, int size)
  6133.  {
  6134.      struct socket *sock;
  6135.      int err;
  6136. diff -u --recursive --new-file v1.3.14/linux/net/unix/sock.c linux/net/unix/sock.c
  6137. --- v1.3.14/linux/net/unix/sock.c    Tue Jun  6 12:16:42 1995
  6138. +++ linux/net/unix/sock.c    Tue Aug  1 10:02:50 1995
  6139. @@ -71,17 +71,17 @@
  6140.                    int *usockaddr_len, int peer);
  6141.  static int unix_proto_read(struct socket *sock, char *ubuf, int size,
  6142.                 int nonblock);
  6143. -static int unix_proto_write(struct socket *sock, char *ubuf, int size,
  6144. +static int unix_proto_write(struct socket *sock, const char *ubuf, int size,
  6145.                  int nonblock);
  6146.  static int unix_proto_select(struct socket *sock, int sel_type, select_table * wait);
  6147.  static int unix_proto_ioctl(struct socket *sock, unsigned int cmd,
  6148.                  unsigned long arg);
  6149.  static int unix_proto_listen(struct socket *sock, int backlog);
  6150. -static int unix_proto_send(struct socket *sock, void *buff, int len,
  6151. +static int unix_proto_send(struct socket *sock, const void *buff, int len,
  6152.                  int nonblock, unsigned flags);
  6153.  static int unix_proto_recv(struct socket *sock, void *buff, int len,
  6154.                  int nonblock, unsigned flags);
  6155. -static int unix_proto_sendto(struct socket *sock, void *buff, int len,
  6156. +static int unix_proto_sendto(struct socket *sock, const void *buff, int len,
  6157.                    int nonblock, unsigned flags,
  6158.                    struct sockaddr *addr, int addr_len);
  6159.  static int unix_proto_recvfrom(struct socket *sock, void *buff, int len,
  6160. @@ -160,7 +160,7 @@
  6161.   *    SendTo() doesn't matter as we also have no Datagram support!
  6162.   */
  6163.  
  6164. -static int unix_proto_sendto(struct socket *sock, void *buff, int len, int nonblock, 
  6165. +static int unix_proto_sendto(struct socket *sock, const void *buff, int len, int nonblock, 
  6166.            unsigned flags,  struct sockaddr *addr, int addr_len)
  6167.  {
  6168.      return(-EOPNOTSUPP);
  6169. @@ -186,12 +186,12 @@
  6170.   *    Send data to a unix socket.
  6171.   */
  6172.   
  6173. -static int unix_proto_send(struct socket *sock, void *buff, int len, int nonblock,
  6174. +static int unix_proto_send(struct socket *sock, const void *buff, int len, int nonblock,
  6175.          unsigned flags)
  6176.  {
  6177.      if (flags != 0) 
  6178.          return(-EINVAL);
  6179. -    return(unix_proto_write(sock, (char *) buff, len, nonblock));
  6180. +    return(unix_proto_write(sock, (const char *) buff, len, nonblock));
  6181.  }
  6182.  
  6183.  
  6184. @@ -676,7 +676,7 @@
  6185.   *    peer has disconnected, which we check other ways.
  6186.   */
  6187.   
  6188. -static int unix_proto_write(struct socket *sock, char *ubuf, int size, int nonblock)
  6189. +static int unix_proto_write(struct socket *sock, const char *ubuf, int size, int nonblock)
  6190.  {
  6191.      struct unix_proto_data *pupd;
  6192.      int todo, space;
  6193.