Commit Graph

11 Commits

Author SHA1 Message Date
Gleb Smirnoff
c1eec6c589 In ng_device_newhook():
- Return meaningful return errorcodes.
  - Free previously allocated connection in error cases.

In ng_device_rcvdata():
  - Return meaningful return errorcodes.
  - Detach mbuf from netgraph item, and free the item before
    doing any other actions that may return from method.
  - Do not call strange malloc() for buffer. [1]
  - In case of any error jump to end, where mbuf is freed.

In ng_device_disconnect():
  - Return meaningful return errorcodes.
  - Free disconnected connection.

style(9) in mentioned above functions:
  - Remove '/* NGD_DEBUG */', when only one line is ifdef'ed.
  - Remove extra braces to easier reading.
  - Add space after comma in function calls.

PR:		kern/41881 (part)
Reviewed by:	marks
Approved by:	julian (mentor)
2004-07-20 13:16:17 +00:00
Gleb Smirnoff
b3e3ef9836 1. Make ng_device.h system include. This fixes module build.
2. Sort includes, while here.
3. s/NULL/0/ in NG_SEND_MSG_HOOK(), since ng_ID_t is integer.

PR:		kern/41881 (part)
Reviewed by:	marks
Approved by:	julian (mentor)
2004-07-20 11:19:46 +00:00
Mark Santcroos
84333769ed Remove 3rd clause from the licence.
Approved by:	njl
2004-06-29 15:46:12 +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
Julian Elischer
f8aae7776f Switch to using C99 sparse initialisers for the type methods array.
Should make no binary difference.

Submitted by:	Gleb Smirnoff <glebius@cell.sick.ru>
Reviewed by:	Harti Brandt <harti@freebsd.org>
MFC after:	1 week
2004-05-29 00:51:19 +00:00
Poul-Henning Kamp
dc08ffec87 Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
2004-02-21 21:10:55 +00:00
Poul-Henning Kamp
c9c7976f7f Device megapatch 1/6:
Free approx 86 major numbers with a mostly automatically generated patch.

A number of strategic drivers have been left behind by caution, and a few
because they still (ab)use their major number.
2004-02-21 19:42:58 +00:00
Hartmut Brandt
87e2c66a6a Get rid of the deprecated *LEN constants in favour of the new
*SIZ constants that include the trailing \0 byte.
2004-01-26 14:05:31 +00:00
Poul-Henning Kamp
7ac40f5f59 Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by:    re(scottl)
2003-03-03 12:15:54 +00:00
Alfred Perlstein
04738e99b5 Catch more uses of MIN(). 2003-02-02 13:30:00 +00:00
Julian Elischer
a835396035 A node that creates a device entry in /dev (yay devfs)
so that /dev/mumble can be the entrypoint to some networking graph,
e.g. a tunnel or a remote tape drive or whatever...

Not fully tested (by me) yet.

Submitted by:	Mark Santcroos <marks@ripe.net>
MFC after:	3 weeks
2002-06-18 21:32:33 +00:00