Commit Graph

23 Commits

Author SHA1 Message Date
dyoung d347ff7717 Prepare for PMF self-suspension: in the if_stop() methods, clear
IFF_UP and IFF_RUNNING before running the 'disable' step, instead
of after.  Soon I will handle the 'disable' step by calling into
PMF, which may call if_stop(, 0).  Ordinarily, that is harmless.
This change lets the if_stop() routines exit early when they find
on entry that IFF_RUNNING is not set.
2008-03-11 23:58:06 +00:00
dyoung aea7bb1ab3 use device_t and accessors. Use aprint_*_dev(). Do not cast the
softc to 'struct device *', but use &sc->bce_dev instead.  Use
PMF_FN_*.
2008-02-22 23:21:01 +00:00
simonb a4c23df6ce Add a simple resume hook that just calls bce_reset(), and register
this with pmf_device_register().

Makes suspend/resume with bce happy.  Much thanks to Jared for help here.
2008-01-30 12:00:35 +00:00
simonb fb673d9599 WextraRemove unused DPRINTF/DPRINTFN macros.
Remove NetBSD 1.6 compatibility checks (way out of date).
Be somewhat consistent (and closer to KNF) with whitespace.
Use uintN_t instead of u_intN_t.

No functional changes.
2008-01-30 11:54:08 +00:00
dyoung ad45c434e8 Use the common code for ethernet media handling. Compiles on i386. 2008-01-19 20:25:44 +00:00
lukem 388339aa58 use __KERNEL_RCSID() 2007-12-11 11:25:46 +00:00
dsl cb40f24fa8 include sys/cdefs.h 2007-07-19 22:00:04 +00:00
ad 88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
dan ce901237e7 teach bce(4) about being an rnd(4) source 2007-03-21 04:56:39 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
mrg 4410329b87 add a pair of new bus_dma(9) functions:
int _bus_dmatag_subregion(bus_dma_tag_t tag,
				  bus_addr_t min_addr,
				  bus_addr_t max_addr,
				  bus_dma_tag_t *newtag,
				  int flags)
	void _bus_dmatag_destroy(bus_dma_tag_t tag)

that allow a (normally broken/limited) device to restrict the bus address
range it can talk to.  this is used by bce(4) to limit DMA addresses to
1GB range, the maximum the chip can address.

all this is from Yorick Hardy <yhardy@uj.ac.za> with input from several
people on tech-kern.

XXX: bus_dma(9) needs an update still.
2007-02-21 20:41:23 +00:00
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
simonb 90498e88b2 s/writting/writing/. 2006-07-07 00:56:15 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
christos 34508c6918 PR/29196: Robert Elz: Add support for Broadcom BCM4401-B0 ethernet 2005-02-02 13:26:06 +00:00
thorpej 505f0442e5 Eliminate use of M_HASFCS. 2005-01-30 17:33:48 +00:00
thorpej d0fcfb4c3a Use ANSI function decls and make use of static. 2004-08-21 23:48:33 +00:00
mycroft 673c114d25 Keep track of what we set the interrupt mask to, rather than reading it from
the chip.
2004-07-09 05:08:22 +00:00
joda 7b46861a55 fix obvious past-o where the activity led register gets overwritten by
the traffic meter led register
2004-04-23 16:03:33 +00:00
mrg 0aad2d6101 - convert to new aprint*() autoconfig print mechanism
- clean up some magic numbers
- make 1.6 friendly
2003-09-29 01:53:02 +00:00
mrg 52b4a4af1d from Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>:
- if_bcereg.h should only have register definitions, so declarations
  of softc structure etc. should be in if_bce.c.
- The types of DMA descriptors should be u_int32_t, not unsigned long.
- netinet headers are not required here.
- Values passed via bce_tx_ring should also be byte-swapped.
- byte-swapping is not needed for bus_space access.

from me:
- KNF
- mark all magic numbers with /* MAGIC */ so they can be identified at
  some point.  there are 33 in total though many appear to be the same
  value, or related (eg, the 6 emac points.)

leaves these issues:
- RX pre-packet headers need to be byte-swapped or not?
- PAGE_SIZE bytes are allocated for both TX and RX DMA ring descriptors,
  but they should be 1024 (== sizeof(struct bce_dma_slot) * N[TR]XDESC).
- the mcast filter.
2003-09-28 01:03:07 +00:00
mrg 871eae696e add new driver for broadcom BCM4401 chipset (as seen on recent dell
laptops) written by Cliff Wright <cliff@snipe444.org> and tested by
yours truly.

XXX: missing mcast filter support.

thanks cliff!
2003-09-27 13:13:28 +00:00