PERFORCE change 142980 for review
Julian Elischer
julian at FreeBSD.org
Thu Jun 5 19:12:44 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=142980
Change 142980 by julian at julian_trafmon1 on 2008/06/05 19:12:41
IFC to 142979
Affected files ...
.. //depot/projects/vimage/src/sys/compat/linux/linux_mib.c#4 integrate
.. //depot/projects/vimage/src/sys/dev/cs/if_cs.c#2 integrate
.. //depot/projects/vimage/src/sys/dev/cs/if_cs_isa.c#3 integrate
.. //depot/projects/vimage/src/sys/dev/cs/if_cs_pccard.c#3 integrate
.. //depot/projects/vimage/src/sys/dev/cs/if_csvar.h#2 integrate
.. //depot/projects/vimage/src/sys/dev/ie/if_ie.c#4 integrate
.. //depot/projects/vimage/src/sys/dev/ie/if_ie_isa.c#4 integrate
.. //depot/projects/vimage/src/sys/dev/if_ndis/if_ndis.c#13 integrate
.. //depot/projects/vimage/src/sys/dev/if_ndis/if_ndisvar.h#5 integrate
.. //depot/projects/vimage/src/sys/dev/usb/ubsa.c#8 integrate
.. //depot/projects/vimage/src/sys/dev/usb/usbdevs#21 integrate
.. //depot/projects/vimage/src/sys/dev/xe/if_xe.c#4 integrate
.. //depot/projects/vimage/src/sys/dev/xe/if_xe_pccard.c#3 integrate
.. //depot/projects/vimage/src/sys/dev/xe/if_xevar.h#3 integrate
.. //depot/projects/vimage/src/sys/fs/devfs/devfs_vnops.c#13 integrate
.. //depot/projects/vimage/src/sys/kern/tty_tty.c#4 integrate
.. //depot/projects/vimage/src/sys/nlm/nlm_prot_impl.c#4 integrate
.. //depot/projects/vimage/src/sys/powerpc/aim/trap.c#3 integrate
.. //depot/projects/vimage/src/sys/security/audit/audit.c#11 integrate
.. //depot/projects/vimage/src/sys/sys/ttydefaults.h#2 integrate
Differences ...
==== //depot/projects/vimage/src/sys/compat/linux/linux_mib.c#4 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/linux/linux_mib.c,v 1.29 2007/01/14 16:07:01 netchild Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/linux/linux_mib.c,v 1.30 2008/06/03 17:50:13 rdivacky Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -82,8 +82,8 @@
0, 0, linux_sysctl_osname, "A",
"Linux kernel OS name");
-static char linux_osrelease[LINUX_MAX_UTSNAME] = "2.4.2";
-static int linux_use_linux26 = 0;
+static char linux_osrelease[LINUX_MAX_UTSNAME] = "2.6.16";
+static int linux_use_linux26 = 1;
static int
linux_sysctl_osrelease(SYSCTL_HANDLER_ARGS)
==== //depot/projects/vimage/src/sys/dev/cs/if_cs.c#2 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/cs/if_cs.c,v 1.45 2006/09/15 15:16:10 glebius Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/cs/if_cs.c,v 1.49 2008/06/05 14:49:35 jhb Exp $");
/*
*
@@ -73,11 +73,13 @@
#endif
static void cs_init(void *);
+static void cs_init_locked(struct cs_softc *);
static int cs_ioctl(struct ifnet *, u_long, caddr_t);
static void cs_start(struct ifnet *);
+static void cs_start_locked(struct ifnet *);
static void cs_stop(struct cs_softc *);
static void cs_reset(struct cs_softc *);
-static void cs_watchdog(struct ifnet *);
+static void cs_watchdog(void *);
static int cs_mediachange(struct ifnet *);
static void cs_mediastatus(struct ifnet *, struct ifmediareq *);
@@ -119,6 +121,16 @@
TUNABLE_INT("hw.cs.recv_delay", &cs_recv_delay);
SYSCTL_INT(_hw_cs, OID_AUTO, recv_delay, CTLFLAG_RW, &cs_recv_delay, 570, "");
+static int cs8900_eeint2irq[16] = {
+ 10, 11, 12, 5, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255
+};
+
+static int cs8900_irq2eeint[16] = {
+ 255, 255, 255, 255, 255, 3, 255, 255,
+ 255, 0, 1, 2, 255, 255, 255, 255
+};
+
static int
get_eeprom_data(struct cs_softc *sc, int off, int len, uint16_t *buffer)
{
@@ -184,7 +196,6 @@
else
self_control &= ~HCB1;
cs_writereg(sc, PP_SelfCTL, self_control);
-
DELAY(500000);
}
@@ -205,7 +216,6 @@
}
DELAY(1000);
}
- DELAY(1000000);
return (error);
}
@@ -215,13 +225,6 @@
cs_writereg(sc, PP_LineCTL, sc->line_ctl & ~AUI_ONLY);
control_dc_dc(sc, 0);
- DELAY( 150000 );
-
- if ((cs_readreg(sc, PP_LineST) & LINK_OK)==0) {
- device_printf(sc->dev, "failed to enable TP\n");
- return (EINVAL);
- }
-
return (0);
}
@@ -278,10 +281,8 @@
cs_writereg(sc, PP_LineCTL,
(sc->line_ctl & ~AUTO_AUI_10BASET) | AUI_ONLY);
- if (!send_test_pkt(sc)) {
- device_printf(sc->dev, "failed to enable AUI\n");
+ if (!send_test_pkt(sc))
return (EINVAL);
- }
return (0);
}
@@ -296,10 +297,8 @@
cs_writereg(sc, PP_LineCTL,
(sc->line_ctl & ~AUTO_AUI_10BASET) | AUI_ONLY);
- if (!send_test_pkt(sc)) {
- device_printf(sc->dev, "failed to enable BNC\n");
+ if (!send_test_pkt(sc))
return (EINVAL);
- }
return (0);
}
@@ -348,7 +347,7 @@
sc->chip_type = chip_type;
- if(chip_type==CS8900) {
+ if (chip_type == CS8900) {
pp_isaint = PP_CS8900_ISAINT;
pp_isadma = PP_CS8900_ISADMA;
sc->send_cmd = TX_CS8900_AFTER_ALL;
@@ -366,7 +365,7 @@
sc->isa_config = 0;
/*
- * If no interrupt specified (or "?"), use what the board tells us.
+ * If no interrupt specified, use what the board tells us.
*/
error = bus_get_resource(dev, SYS_RES_IRQ, 0, &irq, &junk);
@@ -375,101 +374,63 @@
*/
if((cs_readreg(sc, PP_SelfST) & EEPROM_PRESENT) == 0) {
device_printf(dev, "No EEPROM, assuming defaults.\n");
+ } else if (get_eeprom_data(sc,START_EEPROM_DATA,CHKSUM_LEN, eeprom_buff)<0) {
+ device_printf(dev, "EEPROM read failed, assuming defaults.\n");
+ } else if (get_eeprom_cksum(START_EEPROM_DATA,CHKSUM_LEN, eeprom_buff)<0) {
+ device_printf(dev, "EEPROM cheksum bad, assuming defaults.\n");
} else {
- if (get_eeprom_data(sc,START_EEPROM_DATA,CHKSUM_LEN, eeprom_buff)<0) {
- device_printf(dev, "EEPROM read failed, "
- "assuming defaults.\n");
- } else {
- if (get_eeprom_cksum(START_EEPROM_DATA,CHKSUM_LEN, eeprom_buff)<0) {
- device_printf(dev, "EEPROM cheksum bad, "
- "assuming defaults.\n");
+ sc->auto_neg_cnf = eeprom_buff[AUTO_NEG_CNF_OFFSET/2];
+ sc->adapter_cnf = eeprom_buff[ADAPTER_CNF_OFFSET/2];
+ sc->isa_config = eeprom_buff[ISA_CNF_OFFSET/2];
+ for (i=0; i<ETHER_ADDR_LEN/2; i++) {
+ sc->enaddr[i*2] = eeprom_buff[i];
+ sc->enaddr[i*2+1] = eeprom_buff[i] >> 8;
+ }
+ /*
+ * If no interrupt specified, use what the
+ * board tells us.
+ */
+ if (error) {
+ irq = sc->isa_config & INT_NO_MASK;
+ error = 0;
+ if (chip_type == CS8900) {
+ irq = cs8900_eeint2irq[irq];
} else {
- sc->auto_neg_cnf =
- eeprom_buff[AUTO_NEG_CNF_OFFSET/2];
- sc->adapter_cnf =
- eeprom_buff[ADAPTER_CNF_OFFSET/2];
- sc->isa_config =
- eeprom_buff[ISA_CNF_OFFSET/2];
-
- for (i=0; i<ETHER_ADDR_LEN/2; i++) {
- sc->enaddr[i*2]=
- eeprom_buff[i];
- sc->enaddr[i*2+1]=
- eeprom_buff[i] >> 8;
- }
-
- /*
- * If no interrupt specified,
- * use what the board tells us.
- */
- if (error) {
- irq = sc->isa_config & INT_NO_MASK;
- error = 0;
- if (chip_type==CS8900) {
- switch(irq) {
- case 0:
- irq=10;
- break;
- case 1:
- irq=11;
- break;
- case 2:
- irq=12;
- break;
- case 3:
- irq=5;
- break;
- default:
- device_printf(dev, "invalid irq in EEPROM.\n");
- error=EINVAL;
- }
- } else {
- if (irq>CS8920_NO_INTS) {
- device_printf(dev, "invalid irq in EEPROM.\n");
- error=EINVAL;
- }
- }
- if (!error)
- bus_set_resource(dev, SYS_RES_IRQ, 0,
- irq, 1);
- }
+ if (irq > CS8920_NO_INTS)
+ irq = 255;
+ }
+ if (irq == 255) {
+ device_printf(dev, "invalid irq in EEPROM.\n");
+ error = EINVAL;
}
+ if (!error)
+ bus_set_resource(dev, SYS_RES_IRQ, 0,
+ irq, 1);
}
}
- if (!error) {
+ if (!error && !(sc->flags & CS_NO_IRQ)) {
if (chip_type == CS8900) {
- switch(irq) {
- case 5:
- irq = 3;
- break;
- case 10:
- irq = 0;
- break;
- case 11:
- irq = 1;
- break;
- case 12:
- irq = 2;
- break;
- default:
- error=EINVAL;
- }
+ if (irq >= 0 || irq < 16)
+ irq = cs8900_irq2eeint[irq];
+ else
+ irq = 255;
} else {
- if (irq > CS8920_NO_INTS) {
- error = EINVAL;
- }
+ if (irq > CS8920_NO_INTS)
+ irq = 255;
}
+ if (irq == 255)
+ error = EINVAL;
}
- if (!error) {
- if (!(sc->flags & CS_NO_IRQ))
- cs_writereg(sc, pp_isaint, irq);
- } else {
+ if (error) {
device_printf(dev, "Unknown or invalid irq\n");
- return (ENXIO);
+ return (error);
}
+ if (!(sc->flags & CS_NO_IRQ))
+ cs_writereg(sc, pp_isaint, irq);
+
/*
* Temporary disabled
*
@@ -483,8 +444,8 @@
if (bootverbose)
device_printf(dev, "CS89%c0%s rev %c media%s%s%s\n",
- chip_type==CS8900 ? '0' : '2',
- chip_type==CS8920M ? "M" : "",
+ chip_type == CS8900 ? '0' : '2',
+ chip_type == CS8920M ? "M" : "",
chip_revision,
(sc->adapter_cnf & A_CNF_10B_T) ? " TP" : "",
(sc->adapter_cnf & A_CNF_AUI) ? " AUI" : "",
@@ -502,7 +463,8 @@
/*
* Allocate a port resource with the given resource id.
*/
-int cs_alloc_port(device_t dev, int rid, int size)
+int
+cs_alloc_port(device_t dev, int rid, int size)
{
struct cs_softc *sc = device_get_softc(dev);
struct resource *res;
@@ -520,7 +482,8 @@
/*
* Allocate a memory resource with the given resource id.
*/
-int cs_alloc_memory(device_t dev, int rid, int size)
+int
+cs_alloc_memory(device_t dev, int rid, int size)
{
struct cs_softc *sc = device_get_softc(dev);
struct resource *res;
@@ -538,7 +501,8 @@
/*
* Allocate an irq resource with the given resource id.
*/
-int cs_alloc_irq(device_t dev, int rid, int flags)
+int
+cs_alloc_irq(device_t dev, int rid, int flags)
{
struct cs_softc *sc = device_get_softc(dev);
struct resource *res;
@@ -555,7 +519,8 @@
/*
* Release all resources
*/
-void cs_release_resources(device_t dev)
+void
+cs_release_resources(device_t dev)
{
struct cs_softc *sc = device_get_softc(dev);
@@ -582,7 +547,7 @@
int
cs_attach(device_t dev)
{
- int media=0;
+ int error, media=0;
struct cs_softc *sc = device_get_softc(dev);;
struct ifnet *ifp;
@@ -591,18 +556,24 @@
ifp = sc->ifp = if_alloc(IFT_ETHER);
if (ifp == NULL) {
device_printf(dev, "can not if_alloc()\n");
- return (0);
+ cs_release_resources(dev);
+ return (ENOMEM);
}
- cs_stop( sc );
+ mtx_init(&sc->lock, device_get_nameunit(dev), MTX_NETWORK_LOCK,
+ MTX_DEF);
+ callout_init_mtx(&sc->timer, &sc->lock, 0);
+
+ CS_LOCK(sc);
+ cs_stop(sc);
+ CS_UNLOCK(sc);
ifp->if_softc=sc;
if_initname(ifp, device_get_name(dev), device_get_unit(dev));
ifp->if_start=cs_start;
ifp->if_ioctl=cs_ioctl;
- ifp->if_watchdog=cs_watchdog;
ifp->if_init=cs_init;
- ifp->if_snd.ifq_maxlen= IFQ_MAXLEN;
+ IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
/*
* MIB DATA
*/
@@ -611,8 +582,7 @@
ifp->if_linkmiblen=sizeof sc->mibdata;
*/
- ifp->if_flags=(IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST |
- IFF_NEEDSGIANT);
+ ifp->if_flags=(IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST);
/*
* this code still in progress (DMA support)
@@ -633,7 +603,10 @@
sc->buffer=malloc(ETHER_MAX_LEN-ETHER_CRC_LEN,M_DEVBUF,M_NOWAIT);
if (sc->buffer == NULL) {
device_printf(sc->dev, "Couldn't allocate memory for NIC\n");
- return(0);
+ if_free(ifp);
+ mtx_destroy(&sc->lock);
+ cs_release_resources(dev);
+ return(ENOMEM);
}
/*
@@ -684,6 +657,17 @@
ether_ifattach(ifp, sc->enaddr);
+ error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
+ NULL, csintr, sc, &sc->irq_handle);
+ if (error) {
+ ether_ifdetach(ifp);
+ free(sc->buffer, M_DEVBUF);
+ if_free(ifp);
+ mtx_destroy(&sc->lock);
+ cs_release_resources(dev);
+ return (error);
+ }
+
return (0);
}
@@ -696,11 +680,16 @@
sc = device_get_softc(dev);
ifp = sc->ifp;
+ CS_LOCK(sc);
cs_stop(sc);
- ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
+ CS_UNLOCK(sc);
+ callout_drain(&sc->timer);
ether_ifdetach(ifp);
+ bus_teardown_intr(dev, sc->irq_res, sc->irq_handle);
cs_release_resources(dev);
+ free(sc->buffer, M_DEVBUF);
if_free(ifp);
+ mtx_destroy(&sc->lock);
return (0);
}
@@ -711,17 +700,24 @@
cs_init(void *xsc)
{
struct cs_softc *sc=(struct cs_softc *)xsc;
+
+ CS_LOCK(sc);
+ cs_init_locked(sc);
+ CS_UNLOCK(sc);
+}
+
+static void
+cs_init_locked(struct cs_softc *sc)
+{
struct ifnet *ifp = sc->ifp;
- int i, s, rx_cfg;
+ int i, rx_cfg;
/*
- * reset whatchdog timer
+ * reset watchdog timer
*/
- ifp->if_timer=0;
+ sc->tx_timeout = 0;
sc->buf_len = 0;
- s=splimp();
-
/*
* Hardware initialization of cs
*/
@@ -773,13 +769,12 @@
*/
sc->ifp->if_drv_flags |= IFF_DRV_RUNNING;
sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
+ callout_reset(&sc->timer, hz, cs_watchdog, sc);
/*
* Start sending process
*/
- cs_start(ifp);
-
- (void) splx(s);
+ cs_start_locked(ifp);
}
/*
@@ -869,6 +864,7 @@
device_printf(sc->dev, "Interrupt.\n");
#endif
+ CS_LOCK(sc);
while ((status=cs_inw(sc, ISQ_PORT))) {
#ifdef CS_DEBUG
@@ -886,18 +882,18 @@
else
ifp->if_oerrors++;
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
- ifp->if_timer = 0;
+ sc->tx_timeout = 0;
break;
case ISQ_BUFFER_EVENT:
if (status & READY_FOR_TX) {
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
- ifp->if_timer = 0;
+ sc->tx_timeout = 0;
}
if (status & TX_UNDERRUN) {
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
- ifp->if_timer = 0;
+ sc->tx_timeout = 0;
ifp->if_oerrors++;
}
break;
@@ -913,8 +909,9 @@
}
if (!(ifp->if_drv_flags & IFF_DRV_OACTIVE)) {
- cs_start(ifp);
+ cs_start_locked(ifp);
}
+ CS_UNLOCK(sc);
}
/*
@@ -959,12 +956,20 @@
static void
cs_start(struct ifnet *ifp)
{
- int s, length;
+ struct cs_softc *sc = ifp->if_softc;
+
+ CS_LOCK(sc);
+ cs_start_locked(ifp);
+ CS_UNLOCK(sc);
+}
+
+static void
+cs_start_locked(struct ifnet *ifp)
+{
+ int length;
struct mbuf *m, *mp;
struct cs_softc *sc = ifp->if_softc;
- s = splimp();
-
for (;;) {
if (sc->buf_len)
length = sc->buf_len;
@@ -972,7 +977,6 @@
IF_DEQUEUE( &ifp->if_snd, m );
if (m==NULL) {
- (void) splx(s);
return;
}
@@ -1004,8 +1008,7 @@
* and return.
*/
if (!(cs_readreg(sc, PP_BusST) & READY_FOR_TX_NOW)) {
- ifp->if_timer = sc->buf_len;
- (void) splx(s);
+ sc->tx_timeout = sc->buf_len;
ifp->if_drv_flags |= IFF_DRV_OACTIVE;
return;
}
@@ -1017,9 +1020,8 @@
* from board again. (I don't know about correct
* value for this timeout)
*/
- ifp->if_timer = length;
+ sc->tx_timeout = length;
- (void) splx(s);
ifp->if_drv_flags |= IFF_DRV_OACTIVE;
return;
}
@@ -1031,17 +1033,16 @@
static void
cs_stop(struct cs_softc *sc)
{
- int s = splimp();
+ CS_ASSERT_LOCKED(sc);
cs_writereg(sc, PP_RxCFG, 0);
cs_writereg(sc, PP_TxCFG, 0);
cs_writereg(sc, PP_BufCFG, 0);
cs_writereg(sc, PP_BusCTL, 0);
sc->ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
- sc->ifp->if_timer = 0;
-
- (void) splx(s);
+ sc->tx_timeout = 0;
+ callout_stop(&sc->timer);
}
/*
@@ -1050,8 +1051,10 @@
static void
cs_reset(struct cs_softc *sc)
{
+
+ CS_ASSERT_LOCKED(sc);
cs_stop(sc);
- cs_init(sc);
+ cs_init_locked(sc);
}
static uint16_t
@@ -1137,29 +1140,28 @@
{
struct cs_softc *sc=ifp->if_softc;
struct ifreq *ifr = (struct ifreq *)data;
- int s,error=0;
+ int error=0;
#ifdef CS_DEBUG
if_printf(ifp, "%s command=%lx\n", __func__, command);
#endif
- s=splimp();
-
switch (command) {
case SIOCSIFFLAGS:
/*
* Switch interface state between "running" and
* "stopped", reflecting the UP flag.
*/
+ CS_LOCK(sc);
if (sc->ifp->if_flags & IFF_UP) {
if ((sc->ifp->if_drv_flags & IFF_DRV_RUNNING)==0) {
- cs_init(sc);
+ cs_init_locked(sc);
}
} else {
if ((sc->ifp->if_drv_flags & IFF_DRV_RUNNING)!=0) {
cs_stop(sc);
}
- }
+ }
/*
* Promiscuous and/or multicast flags may have changed,
* so reprogram the multicast filter and/or receive mode.
@@ -1167,6 +1169,7 @@
* See note about multicasts in cs_setmode
*/
cs_setmode(sc);
+ CS_UNLOCK(sc);
break;
case SIOCADDMULTI:
@@ -1177,7 +1180,9 @@
*
* See note about multicasts in cs_setmode
*/
+ CS_LOCK(sc);
cs_setmode(sc);
+ CS_UNLOCK(sc);
error = 0;
break;
@@ -1191,7 +1196,6 @@
break;
}
- (void) splx(s);
return (error);
}
@@ -1200,18 +1204,23 @@
* generate an interrupt after a transmit has been started on it.
*/
static void
-cs_watchdog(struct ifnet *ifp)
+cs_watchdog(void *arg)
{
- struct cs_softc *sc = ifp->if_softc;
+ struct cs_softc *sc = arg;
+ struct ifnet *ifp = sc->ifp;
- ifp->if_oerrors++;
- log(LOG_ERR, "%s: device timeout\n", ifp->if_xname);
+ CS_ASSERT_LOCKED(sc);
+ if (sc->tx_timeout && --sc->tx_timeout == 0) {
+ ifp->if_oerrors++;
+ log(LOG_ERR, "%s: device timeout\n", ifp->if_xname);
- /* Reset the interface */
- if (ifp->if_flags & IFF_UP)
- cs_reset(sc);
- else
- cs_stop(sc);
+ /* Reset the interface */
+ if (ifp->if_flags & IFF_UP)
+ cs_reset(sc);
+ else
+ cs_stop(sc);
+ }
+ callout_reset(&sc->timer, hz, cs_watchdog, sc);
}
static int
@@ -1219,11 +1228,15 @@
{
struct cs_softc *sc = ifp->if_softc;
struct ifmedia *ifm = &sc->media;
+ int error;
if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
return (EINVAL);
- return (cs_mediaset(sc, ifm->ifm_media));
+ CS_LOCK(sc);
+ error = cs_mediaset(sc, ifm->ifm_media);
+ CS_UNLOCK(sc);
+ return (error);
}
static void
@@ -1232,6 +1245,7 @@
int line_status;
struct cs_softc *sc = ifp->if_softc;
+ CS_LOCK(sc);
ifmr->ifm_active = IFM_ETHER;
line_status = cs_readreg(sc, PP_LineST);
if (line_status & TENBASET_ON) {
@@ -1256,12 +1270,13 @@
ifmr->ifm_active |= IFM_10_5;
}
}
+ CS_UNLOCK(sc);
}
static int
cs_mediaset(struct cs_softc *sc, int media)
{
- int error;
+ int error = 0;
/* Stop the receiver & transmitter */
cs_writereg(sc, PP_LineCTL, cs_readreg(sc, PP_LineCTL) &
@@ -1274,14 +1289,15 @@
switch (IFM_SUBTYPE(media)) {
default:
case IFM_AUTO:
- if ((error=enable_tp(sc))==0)
- error = cs_duplex_auto(sc);
- else if ((error=enable_bnc(sc)) != 0)
- error = enable_aui(sc);
+ /*
+ * This chip makes it a little hard to support this, so treat
+ * it as IFM_10_T, auto duplex.
+ */
+ enable_tp(sc);
+ cs_duplex_auto(sc);
break;
case IFM_10_T:
- if ((error=enable_tp(sc)) != 0)
- break;
+ enable_tp(sc);
if (media & IFM_FDX)
cs_duplex_full(sc);
else if (media & IFM_HDX)
==== //depot/projects/vimage/src/sys/dev/cs/if_cs_isa.c#3 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/cs/if_cs_isa.c,v 1.7 2007/02/23 12:18:36 piso Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/cs/if_cs_isa.c,v 1.8 2008/06/05 14:49:35 jhb Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -90,7 +90,6 @@
cs_isa_attach(device_t dev)
{
struct cs_softc *sc = device_get_softc(dev);
- int error;
cs_alloc_port(dev, 0, CS_89x0_IO_PORTS);
/* XXX mem appears to not be used at all */
@@ -98,13 +97,6 @@
cs_alloc_memory(dev, sc->mem_rid, sc->mem_used);
cs_alloc_irq(dev, sc->irq_rid, 0);
- error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET,
- NULL, csintr, sc, &sc->irq_handle);
- if (error) {
- cs_release_resources(dev);
- return (error);
- }
-
return (cs_attach(dev));
}
==== //depot/projects/vimage/src/sys/dev/cs/if_cs_pccard.c#3 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/cs/if_cs_pccard.c,v 1.19 2007/02/23 12:18:36 piso Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/cs/if_cs_pccard.c,v 1.20 2008/06/05 14:49:35 jhb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -90,10 +90,6 @@
error = cs_alloc_irq(dev, sc->irq_rid, 0);
if (error != 0)
goto bad;
- error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET,
- NULL, csintr, sc, &sc->irq_handle);
- if (error != 0)
- goto bad;
return (cs_attach(dev));
bad:
==== //depot/projects/vimage/src/sys/dev/cs/if_csvar.h#2 (text+ko) ====
@@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/cs/if_csvar.h,v 1.9 2006/09/15 15:16:10 glebius Exp $
+ * $FreeBSD: src/sys/dev/cs/if_csvar.h,v 1.10 2008/06/05 14:49:35 jhb Exp $
*/
#ifndef _IF_CSVAR_H
@@ -69,8 +69,15 @@
unsigned char *buffer;
int buf_len;
+ struct mtx lock;
+ struct callout timer;
+ int tx_timeout;
};
+#define CS_LOCK(sc) mtx_lock(&(sc)->lock)
+#define CS_UNLOCK(sc) mtx_unlock(&(sc)->lock)
+#define CS_ASSERT_LOCKED(sc) mtx_assert(&(sc)->lock, MA_OWNED)
+
int cs_alloc_port(device_t dev, int rid, int size);
int cs_alloc_memory(device_t dev, int rid, int size);
int cs_alloc_irq(device_t dev, int rid, int flags);
==== //depot/projects/vimage/src/sys/dev/ie/if_ie.c#4 (text+ko) ====
@@ -51,7 +51,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ie/if_ie.c,v 1.109 2008/06/02 19:17:40 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ie/if_ie.c,v 1.110 2008/06/05 14:43:55 jhb Exp $");
/*
* Intel 82586 Ethernet chip
@@ -320,7 +320,7 @@
ifp->if_start = iestart;
ifp->if_ioctl = ieioctl;
ifp->if_init = ieinit;
- ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
+ IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
if (sc->hard_type == IE_EE16)
EVENTHANDLER_REGISTER(shutdown_post_sync, ee16_shutdown,
@@ -1642,12 +1642,12 @@
(ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
sc->promisc =
ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI);
- ieinit(sc);
+ ieinit_locked(sc);
} else if (sc->promisc ^
(ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI))) {
sc->promisc =
ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI);
- ieinit(sc);
+ ieinit_locked(sc);
}
IE_UNLOCK(sc);
break;
==== //depot/projects/vimage/src/sys/dev/ie/if_ie_isa.c#4 (text+ko) ====
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ie/if_ie_isa.c,v 1.8 2008/06/02 19:17:40 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ie/if_ie_isa.c,v 1.9 2008/06/05 14:45:32 jhb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -802,11 +802,13 @@
DEVMETHOD(device_detach, ie_detach),
{ 0, 0 }
};
+
static driver_t ie_isa_3C507_driver = {
"ie",
ie_isa_3C507_methods,
sizeof(struct ie_softc),
};
+
DRIVER_MODULE(ie_3C507, isa, ie_isa_3C507_driver, ie_devclass, ie_modevent, 0);
MODULE_DEPEND(ie_3C507, elink, 1, 1, 1);
@@ -817,12 +819,14 @@
DEVMETHOD(device_detach, ie_detach),
{ 0, 0 }
};
+
static driver_t ie_isa_ee16_driver = {
"ie",
ie_isa_ee16_methods,
sizeof(struct ie_softc),
};
-DRIVER_MODULE(ie_EE16, isa, ie_isa_ee16_driver, ie_devclass, ie_modevent, 0);
+
+DRIVER_MODULE(ie, isa, ie_isa_ee16_driver, ie_devclass, ie_modevent, 0);
static device_method_t ie_isa_sl_methods[] = {
DEVMETHOD(device_probe, ie_isa_sl_probe),
@@ -830,11 +834,13 @@
DEVMETHOD(device_detach, ie_detach),
{ 0, 0 }
};
+
static driver_t ie_isa_sl_driver = {
"ie",
ie_isa_sl_methods,
sizeof(struct ie_softc),
};
+
DRIVER_MODULE(ie_SL, isa, ie_isa_sl_driver, ie_devclass, ie_modevent, 0);
static int
==== //depot/projects/vimage/src/sys/dev/if_ndis/if_ndis.c#13 (text+ko) ====
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis.c,v 1.140 2008/05/30 07:17:51 weongyo Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis.c,v 1.141 2008/06/03 00:55:48 cokane Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -161,7 +161,6 @@
static void ndis_scan_mindwell (struct ieee80211_scan_state *);
static void ndis_init (void *);
static void ndis_stop (struct ndis_softc *);
-static void ndis_watchdog (struct ifnet *);
static int ndis_ifmedia_upd (struct ifnet *);
static void ndis_ifmedia_sts (struct ifnet *, struct ifmediareq *);
static void ndis_auth (void *, int);
@@ -537,6 +536,7 @@
KeInitializeSpinLock(&sc->ndis_spinlock);
KeInitializeSpinLock(&sc->ndis_rxlock);
InitializeListHead(&sc->ndis_shlist);
+ callout_init(&sc->ndis_stat_callout, CALLOUT_MPSAFE);
if (sc->ndis_iftype == PCMCIABus) {
error = ndis_alloc_amem(sc);
@@ -695,7 +695,6 @@
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_ioctl = ndis_ioctl;
ifp->if_start = ndis_start;
- ifp->if_watchdog = ndis_watchdog;
ifp->if_init = ndis_init;
ifp->if_baudrate = 10000000;
IFQ_SET_MAXLEN(&ifp->if_snd, 50);
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list