DragonFly BSD
DragonFly users List (threaded) for 2006-09
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Hints on kernel config for a dula pII/450 system anyone?


From: Gergo Szakal <bastyaelvtars@xxxxxxxxx>
Date: Thu, 21 Sep 2006 01:02:08 +0200

70609180744s1fbbd3eft59de1a31d213067a@xxxxxxxxxxxxxx>	 <450eb994$0$790$415eb37d@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <ea7b9c170609181925q2143ec01je9e0c0e47524b81f@xxxxxxxxxxxxxx> <45114ce2$0$789$415eb37d@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <200609201629.k8KGTBir090919@xxxxxxxxxxxxxxxxxxxx> <451173d1$0$788$415eb37d@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <200609202150.k8KLoOFP092992@xxxxxxxxxxxxxxxxxxxx> <4511c34b$0$789$415eb37d@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <4511C65C.20203@xxxxxxxxxxx>
In-Reply-To: <4511C65C.20203@xxxxxxxxxxx>
Content-Type: multipart/mixed;
 boundary="------------030507010402020801050109"
Lines: 224
Message-ID: <4511c833$0$789$415eb37d@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
NNTP-Posting-Host: 160.114.118.67
X-Trace: 1158793268 crater_reader.dragonflybsd.org 789 160.114.118.67
Xref: crater_reader.dragonflybsd.org dragonfly.users:7320

This is a multi-part message in MIME format.
--------------030507010402020801050109
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Scott Ullrich wrote:
> 
> I am coming into this a bit late.  What version is this again?
> 

This is 1.6-release (snapshot from yesterday, got the tarball from 
chlamydia) and applied the attached patch made by Sepherosa.

--------------030507010402020801050109
Content-Type: text/plain;
 name="sk_ser1.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="sk_ser1.diff"

diff -ur sk_rel/if_sk.c sk_mod/if_sk.c
--- if_sk.c	2006-09-18 20:07:30.000000000 -0400
+++ if_sk.c	2006-09-19 09:32:14.914282864 -0400
@@ -261,7 +261,6 @@
 
 static DEFINE_CLASS_0(sk, sk_driver, sk_methods, sizeof(struct sk_if_softc));
 static devclass_t sk_devclass;
-static struct lwkt_serialize sk_serializer;
 
 DECLARE_DUMMY_MODULE(if_sk);
 DRIVER_MODULE(if_sk, pci, skc_driver, skc_devclass, 0, 0);
@@ -1076,7 +1075,6 @@
 	struct sk_type *t;
 	uint16_t vendor, product;
 
-	lwkt_serialize_init(&sk_serializer);
 	vendor = pci_get_vendor(dev);
 	product = pci_get_device(dev);
 
@@ -1166,12 +1164,17 @@
 {
 	struct sk_softc *sc = device_get_softc(device_get_parent(dev));
 	struct sk_if_softc *sc_if = device_get_softc(dev);
+ 	struct sk_attach_arg *skca;
+	struct lwkt_serialize *serializer;
 	struct ifnet *ifp;
 	int i, port;
 
-	port = *(int *)device_get_ivars(dev);
+ 	skca = device_get_ivars(dev);
+ 	port = skca->port;
+	serializer = skca->serializer;
 	free(device_get_ivars(dev), M_DEVBUF);
 	device_set_ivars(dev, NULL);
+
 	sc_if->sk_dev = dev;
 	callout_init(&sc_if->sk_tick_timer);
 	lwkt_serialize_init(&sc_if->sk_jslot_serializer);
@@ -1312,7 +1315,7 @@
 	/*
 	 * Call MI attach routine.
 	 */
-	ether_ifattach(ifp, sc_if->arpcom.ac_enaddr, &sk_serializer);
+	ether_ifattach(ifp, sc_if->arpcom.ac_enaddr, serializer);
 	callout_init(&sc_if->sk_tick_timer);
 
 	return(0);
@@ -1325,14 +1328,16 @@
 static int
 skc_attach(device_t dev)
 {
-	struct sk_softc *sc;
-	int error = 0, *port, rid, unit;
+	struct sk_softc *sc = device_get_softc(dev);;
+	struct sk_attach_arg *skca;
+	int error = 0, rid, unit;
 	uint32_t command;
 	uint8_t skrs;
 
 	crit_enter();
 
-	sc = device_get_softc(dev);
+	lwkt_serialize_init(&sc->sk_serializer);
+
 	unit = device_get_unit(dev);
 	switch (pci_get_device(dev)) {
 	case DEVICEID_SK_V1:
@@ -1421,7 +1426,7 @@
 
 	error = bus_setup_intr(dev, sc->sk_irq, INTR_NETSAFE,
 			       sk_intr, sc,
-			       &sc->sk_intrhand, &sk_serializer);
+			       &sc->sk_intrhand, &sc->sk_serializer);
 
 	if (error) {
 		printf("skc%d: couldn't set up irq\n", unit);
@@ -1504,15 +1509,17 @@
 	/* Announce the product name. */
 	printf("skc%d: %s\n", sc->sk_unit, sc->sk_vpd_prodname);
 	sc->sk_devs[SK_PORT_A] = device_add_child(dev, "sk", -1);
-	port = malloc(sizeof(int), M_DEVBUF, M_WAITOK);
-	*port = SK_PORT_A;
-	device_set_ivars(sc->sk_devs[SK_PORT_A], port);
+ 	skca = malloc(sizeof(*skca), M_DEVBUF, M_WAITOK);
+ 	skca->port = SK_PORT_A;
+ 	skca->serializer = &sc->sk_serializer;
+ 	device_set_ivars(sc->sk_devs[SK_PORT_A], skca);
 
 	if (!(sk_win_read_1(sc, SK_CONFIG) & SK_CONFIG_SINGLEMAC)) {
 		sc->sk_devs[SK_PORT_B] = device_add_child(dev, "sk", -1);
-		port = malloc(sizeof(int), M_DEVBUF, M_WAITOK);
-		*port = SK_PORT_B;
-		device_set_ivars(sc->sk_devs[SK_PORT_B], port);
+ 		skca = malloc(sizeof(*skca), M_DEVBUF, M_WAITOK);
+ 		skca->port = SK_PORT_B;
+ 		skca->serializer = &sc->sk_serializer;
+ 		device_set_ivars(sc->sk_devs[SK_PORT_B], skca);
 	}
 
 	/* Turn on the 'driver is loaded' LED. */
@@ -1548,7 +1555,7 @@
 
 	sc = device_get_softc(dev);
 
-	lwkt_serialize_enter(&sk_serializer);
+	lwkt_serialize_enter(&sc->sk_serializer);
 
 	if (sc->sk_if[SK_PORT_A] != NULL)
 		sk_stop(sc->sk_if[SK_PORT_A]);
@@ -1557,7 +1564,7 @@
 
 	bus_teardown_intr(dev, sc->sk_irq, sc->sk_intrhand);
 
-	lwkt_serialize_exit(&sk_serializer);
+	lwkt_serialize_exit(&sc->sk_serializer);
 
 	/*
 	 * recursed from sk_detach ?  don't need serializer
@@ -1685,7 +1692,7 @@
 {
 	struct sk_softc *sc = device_get_softc(dev);
 
-	lwkt_serialize_enter(&sk_serializer);
+	lwkt_serialize_enter(&sc->sk_serializer);
 
 	/* Turn off the 'driver is loaded' LED. */
 	CSR_WRITE_2(sc, SK_LED, SK_LED_GREEN_OFF);
@@ -1695,7 +1702,7 @@
 	 * assert the resets on the attached XMAC(s).
 	 */
 	sk_reset(sc);
-	lwkt_serialize_exit(&sk_serializer);
+	lwkt_serialize_exit(&sc->sk_serializer);
 }
 
 static void
@@ -1794,20 +1801,21 @@
 sk_tick(void *xsc_if)
 {
 	struct sk_if_softc *sc_if = xsc_if;
+	struct sk_softc *sc = sc_if->sk_softc;
 	struct ifnet *ifp = &sc_if->arpcom.ac_if;
 	struct mii_data *mii = device_get_softc(sc_if->sk_miibus);
 	int i;
 
-	lwkt_serialize_enter(&sk_serializer);
+	lwkt_serialize_enter(&sc->sk_serializer);
 
 	if ((ifp->if_flags & IFF_UP) == 0) {
-		lwkt_serialize_exit(&sk_serializer);
+		lwkt_serialize_exit(&sc->sk_serializer);
 		return;
 	}
 
 	if (sc_if->sk_phytype == SK_PHYTYPE_BCOM) {
 		sk_intr_bcom(sc_if);
-		lwkt_serialize_exit(&sk_serializer);
+		lwkt_serialize_exit(&sc->sk_serializer);
 		return;
 	}
 
@@ -1825,7 +1833,7 @@
 
 	if (i != 3) {
 		callout_reset(&sc_if->sk_tick_timer, hz, sk_tick, sc_if);
-		lwkt_serialize_exit(&sk_serializer);
+		lwkt_serialize_exit(&sc->sk_serializer);
 		return;
 	}
 
@@ -1835,7 +1843,7 @@
 	mii_tick(mii);
 	mii_pollstat(mii);
 	callout_stop(&sc_if->sk_tick_timer);
-	lwkt_serialize_exit(&sk_serializer);
+	lwkt_serialize_exit(&sc->sk_serializer);
 }
 
 static void
diff -ur sk_rel/if_skreg.h sk_mod/if_skreg.h
--- if_skreg.h	2006-09-18 20:07:58.000000000 -0400
+++ if_skreg.h	2006-09-19 09:30:48.405434208 -0400
@@ -1434,6 +1434,7 @@
 	uint32_t		sk_intrmask;
 	struct sk_if_softc	*sk_if[2];
 	device_t		sk_devs[2];
+	struct lwkt_serialize	sk_serializer;
 };
 
 /* Softc for each logical interface */
@@ -1462,6 +1463,11 @@
 	struct lwkt_serialize	sk_jslot_serializer;
 };
 
+struct sk_attach_arg {
+	int						port;
+	struct lwkt_serialize	*serializer;
+};
+
 #define SK_MAXUNIT	256
 #define SK_TIMEOUT	1000
 #define ETHER_ALIGN	2

--------------030507010402020801050109--



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]