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?
mmm, try the attachment :-)
On 9/18/06, Gergo Szakal <bastyaelvtars@xxxxxxxxx> wrote:
:-)
A new crash,right when starting the network.
http://rnrdoctor.sytes.net/dfcrash/
(bug1.jpg and bug2.jpg)
--
Live Free or Die
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
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]