kern/87845: sio(4) should on probe return BUS_PROBE_GENERIC to allow other drivers to attach [fix]

Frank Behrens frank at pinky.sax.de
Sat Oct 22 08:50:17 PDT 2005


>Number:         87845
>Category:       kern
>Synopsis:       sio(4) should on probe return BUS_PROBE_GENERIC to allow other drivers to attach [fix]
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 22 15:50:16 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Frank Behrens
>Release:        FreeBSD 6.0-BETA3-200508221325 i386
>Organization:
>Environment:
	all FreeBSD 5.x/6.x/7.x
>Description:
For special communication protocols it is necessary to replace the sio(4) driver.
But the sio driver returns on bus probe always BUS_PROBE_SPECIFIC, what indicates the highest
priority and prohibits the attachment of other drivers.

sio(4) should return BUS_PROBE_GENERIC on successful bus probe. This allows an attachment of a
more specific driver. Other drivers (e.g. puc(4)i) do this already.

The proposed behavior conforms to DEVICE_PROBE(9) and the comments in /usr/include/sys/bus.h:
	#define BUS_PROBE_SPECIFIC      0       /* Only I can use this device */
	#define BUS_PROBE_GENERIC       (-100)  /* generic driver for dev */

The changed driver should be MFCed to RELENG_6.

>How-To-Repeat:
>Fix:

--- sioprobe6_050828.patch begins here ---
--- sys/dev/sio/sio.c.orig	Thu Jul 21 15:21:20 2005
+++ sys/dev/sio/sio.c	Tue Aug 23 17:38:58 2005
@@ -700,7 +700,7 @@
 			device_set_softc(dev, NULL);
 			free(com, M_DEVBUF);
 		}
-		return (result);
+		return (result==0? BUS_PROBE_DEFAULT : result);
 	}
 
 	/*
@@ -777,7 +777,7 @@
 		device_set_softc(dev, NULL);
 		free(com, M_DEVBUF);
 	}
-	return (result);
+	return (result==0? BUS_PROBE_DEFAULT : result);
 }
 
 #ifdef COM_ESP
--- sioprobe6_050828.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list