Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 May 1998 23:13:53 +0300 (IDT)
From:      Yuri Krichevsky <yury@nest.bistbn.com>
To:        freebsd-hackers@FreeBSD.ORG
Cc:        grog@lemis.com, roberps@louisville.stortek.com, alessandro@digicron.com
Subject:   Serial port driver patch (update for 2.2.6-R)
Message-ID:  <199805142013.XAA01684@nest.bistbn.com>

next in thread | raw e-mail | index | archive | help


	Hi.

	Here is updated patch (that can be applied to FreeBSD-2.2.6-R )
	for sio driver. 

	If you using motherboard with UART from Acer Labs
	(for example, IWill motherboard), and FreeBSD can't detect
	your serial port - this patch is for you ;-)

	You can get it from WWW also :

	http://nest.bistbn.com/~yury/FreeBSD/sio.patch/sio.patch.2.2.5-R
			(for FreeBSD 2.2.5-RELEASE)
	http://nest.bistbn.com/~yury/FreeBSD/sio.patch/sio.patch.2.2.6-R
			(for FreeBSD 2.2.6-RELEASE)

	BTW, 2Mike: where is promised workaround in 2.2.6 ? :(


NB:	DONT use this patch if you don't have any problem with serial
	port detection !


*** /sys/i386/isa/sio.c.orig	Sun Mar  8 11:57:35 1998
--- /sys/i386/isa/sio.c	Thu May 14 22:39:07 1998
***************
*** 489,495 ****
  	struct isa_device	*dev;
  {
  	static bool_t	already_init;
! 	bool_t		failures[10];
  	int		fn;
  	struct isa_device	*idev;
  	Port_t		iobase;
--- 489,495 ----
  	struct isa_device	*dev;
  {
  	static bool_t	already_init;
! 	bool_t		failures[12];
  	int		fn;
  	struct isa_device	*idev;
  	Port_t		iobase;
***************
*** 653,668 ****
  	enable_intr();
  
  	result = IO_COMSIZE;
! 	for (fn = 0; fn < sizeof failures; ++fn)
! 		if (failures[fn]) {
! 			outb(iobase + com_mcr, 0);
! 			result = 0;
! 			if (COM_VERBOSE(dev))
! 				printf("sio%d: probe test %d failed\n",
! 				       dev->id_unit, fn);
! 		}
! 	return (result);
! }
  
  #ifdef COM_ESP
  static int
--- 653,719 ----
  	enable_intr();
  
  	result = IO_COMSIZE;
! 
!  
!  	/*
!  	 * Patch (C) Yuri Krichevsky (yury@bistbn.com)
!  	 *
!  	 * If we have'nt found serial port yet, maybe it's strange
!  	 * serial port... (like on IWill motherboard)
!  	 *
!  	 *
!  	 * !WARNING! It's only temporary solution ! Use this patch only if
!  	 * you have problems with serial ports !
!  	 *
!  	 */
!  	 if (sizeof failures) {
!  	 {
!  		result = IO_COMSIZE;
!  			  
!  		/*
!  		 * Probing port as described in article
!  		 * 'The Serial Port' (C) Chris Blum (chris@phil.uni-sb.de)
!  		 * http://colargol.tihlde.hist.no/~bardj/serial/
!  		 */
!  
!         		outb(iobase + com_mcr, 0x10);
!         		if ((inb(iobase + com_msr) & 0xf0)) {
!  			failures[10] = 1;
!  			result = 0;
!         		} else {
!         		   outb(iobase + com_mcr, 0x1f);
!         		   if ((inb(iobase + com_msr) & 0xf0) != 0xf0) {
!  			failures[11] = 1;
!   			result = 0;
!         		    } else {
!  		  /*
!  		   * UART detected (I hope, it's UART).
!  		   */
!         			outb(iobase + com_cfcr, CFCR_8BITS);
!         			outb(iobase + com_ier, 0x0);
!         			outb(iobase + com_mcr, MCR_IENABLE);
!  		    }
!  		}
!  
!  	  }
!  	}
!  	/*
!  	 * END of patch
!  	 */
!  	if ( !result ) {
!  		for (fn = 0; fn < sizeof failures; ++fn)
!  			if (failures[fn]) {
!  				outb(iobase + com_mcr, 0);
!  				result = 0;
!  				if (COM_VERBOSE(dev))
!  					printf("sio%d: probe test %d failed\n",
!  				       	dev->id_unit, fn);
!  			}
!  	}
!  
!   	return (result);
!   }
!   
  
  #ifdef COM_ESP
  static int

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199805142013.XAA01684>