Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Sep 1999 12:03:47 -0500 (CDT)
From:      bugs@freebsd.netcom.com (Mark Hittinger)
To:        freebsd-current@freebsd.org
Subject:   patch for if_ed.c ed_probe_HP_pclanp() returns OK when shouldn't
Message-ID:  <199909131703.MAA02985@freebsd.netcom.com.>

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

Hi

Inside ed_probe_HP_pclanp() we are doing various checks to see if the device
is there and if we hit a problem we return 0 instead of an error.  Attached
is a patch for this problem.

Regards,

Mark Hittinger
Mindspring/Netcom/Dallas
bugs@freebsd.netcom.com

*** if_ed.c.1	Mon Sep 13 16:31:29 1999
--- if_ed.c	Mon Sep 13 16:48:33 1999
***************
*** 1387,1391 ****
  	    ((inb(sc->asic_addr + ED_HPP_ID + 2) & 0xF0) != 0) ||
  	    (inb(sc->asic_addr + ED_HPP_ID + 3) != 0x53))
! 		return 0;
  
  	/* 
--- 1387,1391 ----
  	    ((inb(sc->asic_addr + ED_HPP_ID + 2) & 0xF0) != 0) ||
  	    (inb(sc->asic_addr + ED_HPP_ID + 3) != 0x53))
! 		return(ENXIO);
  
  	/* 
***************
*** 1401,1405 ****
  
  	if (checksum != 0xFF)
! 		return 0;
  
  	/*
--- 1401,1405 ----
  
  	if (checksum != 0xFF)
! 		return(ENXIO);
  
  	/*
***************
*** 1410,1414 ****
  	if (((sc->hpp_id = inw(sc->asic_addr + ED_HPP_PAGE_4)) & 
  		ED_HPP_ID_SOFT_MODEL_MASK) != 0x0000)
! 		return 0;
  
  	/*
--- 1410,1414 ----
  	if (((sc->hpp_id = inw(sc->asic_addr + ED_HPP_PAGE_4)) & 
  		ED_HPP_ID_SOFT_MODEL_MASK) != 0x0000)
! 		return(ENXIO);
  
  	/*
***************
*** 1441,1445 ****
  
  	if (!(inb(sc->nic_addr + ED_P0_ISR) & ED_ISR_RST))
! 		return 0;	/* reset did not complete */
  
  	/*
--- 1441,1445 ----
  
  	if (!(inb(sc->nic_addr + ED_P0_ISR) & ED_ISR_RST))
! 		return(ENXIO);	/* reset did not complete */
  
  	/*
***************
*** 1456,1460 ****
  
  	if (irq >= (sizeof(ed_hpp_intr_val) / sizeof(ed_hpp_intr_val[0])))
! 		return 0;
  
  	/* 
--- 1456,1460 ----
  
  	if (irq >= (sizeof(ed_hpp_intr_val) / sizeof(ed_hpp_intr_val[0])))
! 		return(ENXIO);
  
  	/* 
***************
*** 1521,1525 ****
  		
  		if (mem_addr != conf_maddr)
! 			return 0;
  
  		error = ed_alloc_memory(dev, 0, memsize);
--- 1521,1525 ----
  		
  		if (mem_addr != conf_maddr)
! 			return(ENXIO);
  
  		error = ed_alloc_memory(dev, 0, memsize);
***************
*** 1609,1613 ****
  		if (bcmp(test_pattern, test_buffer, 
  			sizeof(test_pattern)))
! 			return 0;
  	}
  
--- 1609,1613 ----
  		if (bcmp(test_pattern, test_buffer, 
  			sizeof(test_pattern)))
! 			return(ENXIO);
  	}
  


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




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