Commit Graph

30 Commits

Author SHA1 Message Date
Poul-Henning Kamp
c40da00ca3 Since DELAY() was moved, most <machine/clock.h> #includes have been
unnecessary.
2006-05-16 14:37:58 +00:00
Roman Kurakin
3dde86fe4c Backout if_cp 1.26, if_ct 1.27, if_cx 1.47 by obrien:
----------------------------
	revision 1.26
	date: 2005/09/07 09:53:35;  author: obrien;  state: Exp;  lines: +1452 -1453
	Reorder code to not depend on an ISO-C illegal forward extern declaration.
	----------------------------

Reason: do not move large functions location without serious reason. The same
could be done by forward function declaration. Please do not enlarge diff
without a reason any more.

Backout if_cp 1.27
----------------------------
	revision 1.27
	date: 2005/09/19 03:10:16;  author: imp;  state: Exp;  lines: +3 -2
	Make sure that we call if_free(ifp) after bus_teardown_intr.  Since we
	could get an interrupt after we free the ifp, and the interrupt
	handler depended on the ifp being still alive, this could, in theory,
	cause a crash.  Eliminate this possibility by moving the if_free to
	after the bus_teardown_intr() call.

Reason: bad previous commit. Would be restored by next commit.
2005-09-27 16:12:49 +00:00
David E. O'Brien
8070a603b2 Reorder code to not depend on an ISO-C illegal forward extern declaration. 2005-09-07 09:53:35 +00:00
Robert Watson
13f4c340ae Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and
IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to
ifnet.if_drv_flags.  Device drivers are now responsible for
synchronizing access to these flags, as they are in if_drv_flags.  This
helps prevent races between the network stack and device driver in
maintaining the interface flags field.

Many __FreeBSD__ and __FreeBSD_version checks maintained and continued;
some less so.

Reviewed by:	pjd, bz
MFC after:	7 days
2005-08-09 10:20:02 +00:00
Roman Kurakin
0541e456c9 Use m_length (m, NULL) instead of m->m_pkthdr.len.
Problems reported by: strijar at urai dot ru
Approved by:	re (scottl)
2005-07-09 16:14:05 +00:00
Roman Kurakin
de66928b86 Protect from partially initialized channels.
Approved by:	re (scottl)
2005-07-09 14:03:02 +00:00
Roman Kurakin
23f924934d Space & alignment nits.
Approved by:	re (scottl)
2005-07-09 13:44:36 +00:00
Brooks Davis
fc74a9f93a Stop embedding struct ifnet at the top of driver softcs. Instead the
struct ifnet or the layer 2 common structure it was embedded in have
been replaced with a struct ifnet pointer to be filled by a call to the
new function, if_alloc(). The layer 2 common structure is also allocated
via if_alloc() based on the interface type. It is hung off the new
struct ifnet member, if_l2com.

This change removes the size of these structures from the kernel ABI and
will allow us to better manage them as interfaces come and go.

Other changes of note:
 - Struct arpcom is no longer referenced in normal interface code.
   Instead the Ethernet address is accessed via the IFP2ENADDR() macro.
   To enforce this ac_enaddr has been renamed to _ac_enaddr.
 - The second argument to ether_ifattach is now always the mac address
   from driver private storage rather than sometimes being ac_enaddr.

Reviewed by:	sobomax, sam
2005-06-10 16:49:24 +00:00
Poul-Henning Kamp
92d4c5d082 Use dynamic major number allocation. 2005-02-27 22:16:58 +00:00
Warner Losh
098ca2bda9 Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
Roman Kurakin
f41d84e53a Make code MPSAFE.
You could turn this off by debug.mpsafenet=0 for full network
stack or via debug.{cp|cx|ctau}.mpsafenet for cp(4), cx(4) and
ctau(4) accordingly.

MFC after:	10 days
2004-12-13 22:07:23 +00:00
Roman Kurakin
02a6dae6e0 Clean up from '#if __FreeBSD_version'. 2004-12-10 05:54:45 +00:00
Roman Kurakin
052bf4427f Don not call pp_down()/pp_up() form XX_tlf()/XX_tls() in non PPP mode
to privent running of PPP's state machine in non PPP mode.

MFC: after 3 days.
2004-12-03 16:57:15 +00:00
Poul-Henning Kamp
3ad06fbb46 Remove bogus cdevsw frobbing code which tries to prevent double
loading of modules.

MODULE_VERSION() should be used for this I belive.
2004-09-23 12:21:11 +00:00
Roman Kurakin
6b1cbdfc68 Make code ready to switch debug.mpsafenet to 1 since I've not able to
commit MPSAFE code for now it is just IFF_NEEDSGIANT.
2004-08-27 22:14:26 +00:00
Roman Kurakin
47a1257e20 Fix resource check while autodetection. 2004-08-13 12:35:52 +00:00
Roman Kurakin
d71a0dc2e6 White space cleanup. 2004-08-13 12:22:01 +00:00
Julian Elischer
be4252b367 Slight cosmetic changes.
Also introduce a macro to be called by persistent nodes to signal their
persistence during shutdown to hide this mechanism from the node author.

Make node flags have a consistent style in naming.

Document the change.
2004-07-20 17:15:38 +00:00
Julian Elischer
327b288e5c Convert Netgraph to use mbuf tags to pass its meta information around.
Thanks to Sam for importing tags in a way that allowed this to be done.

Submitted by:	Gleb Smirnoff <glebius@cell.sick.ru>
Also allow the sr and ar drivers to create netgraph versions of their modules.
Document the change to the ksocket node.
2004-06-25 19:22:05 +00:00
Roman Kurakin
de98a7eeee Use bus_dma* instead of contigmalloc()+vtophys() for RELENG_5. 2004-06-23 18:13:10 +00:00
Roman Kurakin
3cc90ff9d1 Make code more clean: backout support for 3.x branch. 2004-06-23 11:23:54 +00:00
Poul-Henning Kamp
f3732fd15b Second half of the dev_t cleanup.
The big lines are:
	NODEV -> NULL
	NOUDEV -> NODEV
	udev_t -> dev_t
	udev2dev() -> findcdev()

Various minor adjustments including handling of userland access to kernel
space struct cdev etc.
2004-06-17 17:16:53 +00:00
Poul-Henning Kamp
89c9c53da0 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
Poul-Henning Kamp
fe12f24bb0 Add missing <sys/module.h> includes 2004-05-30 20:08:47 +00:00
Roman Kurakin
24f6353dc4 Switch to using C99 sparse initialisers for the type methods array.
Requested by:	harti

MFC after:	1 week
2004-05-29 13:17:28 +00:00
Roman Kurakin
8ad3557f05 Use better way of closing fr support before current sppp get it. 2004-05-07 11:59:54 +00:00
Roman Kurakin
e97da3ff02 Sync with RELENG_4 2004-05-07 11:56:07 +00:00
Bruce M Simpson
5f5a4d72d6 Nursemaid: Fix tinderbox builds by removing the shadowing of the global
preprocessor macro DEBUG. DEBUG() -> CTAU_DEBUG().
2004-03-04 14:16:12 +00:00
Roman Kurakin
752aeaf074 1. Renames NCT constant to NCTAU. This will help while MFC to 4 branch.
2. Fix compilation and panic while system boot problem after makedev
was changed to unde2dev.

Approved by: imp (mentor)
2004-03-02 16:39:40 +00:00
Roman Kurakin
cee1270c1a Add support for Cronyx-Tau. For now I added only Tau-ISA files, system files
would be changed in next patches, after extra verifications.

Approved by: imp (mentor)
2004-02-23 20:19:00 +00:00