summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/bluetooth/drivers
diff options
context:
space:
mode:
authoremax <emax@FreeBSD.org>2004-11-02 20:01:42 +0000
committeremax <emax@FreeBSD.org>2004-11-02 20:01:42 +0000
commit29562d9fdc7b88c8313b9ff2d114ae7825f959d0 (patch)
tree57c0eb93819d33a50986bad6d915016d71967f8f /sys/netgraph/bluetooth/drivers
parent9ff4238c2a4f9c95d86a4960a32c80ae725da372 (diff)
downloadFreeBSD-src-29562d9fdc7b88c8313b9ff2d114ae7825f959d0.zip
FreeBSD-src-29562d9fdc7b88c8313b9ff2d114ae7825f959d0.tar.gz
Fix broken ng_h4(4). Basically, do not abuse t_sc field and use new t_lsc
field created for line disciplne drivers private use. Also add NET_NEEDS_GIANT warning. For whatever reason ng_tty(4) was fixed but ng_h4(4) was not :(
Diffstat (limited to 'sys/netgraph/bluetooth/drivers')
-rw-r--r--sys/netgraph/bluetooth/drivers/h4/ng_h4.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/netgraph/bluetooth/drivers/h4/ng_h4.c b/sys/netgraph/bluetooth/drivers/h4/ng_h4.c
index 1710a4c..c532ac0 100644
--- a/sys/netgraph/bluetooth/drivers/h4/ng_h4.c
+++ b/sys/netgraph/bluetooth/drivers/h4/ng_h4.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ng_h4.c,v 1.5 2003/05/10 05:51:25 max Exp $
+ * $Id: ng_h4.c,v 1.7 2004/08/23 18:08:15 max Exp $
* $FreeBSD$
*
* Based on:
@@ -70,6 +70,8 @@
*****************************************************************************
*****************************************************************************/
+NET_NEEDS_GIANT("ng_h4");
+
/* MALLOC define */
#ifndef NG_SEPARATE_MALLOC
MALLOC_DEFINE(M_NETGRAPH_H4, "netgraph_h4", "Netgraph Bluetooth H4 node");
@@ -199,7 +201,7 @@ ng_h4_open(struct cdev *dev, struct tty *tp)
/* Set back pointers */
NG_NODE_SET_PRIVATE(sc->node, sc);
- tp->t_sc = (caddr_t) sc;
+ tp->t_lsc = (caddr_t) sc;
/* The node has to be a WRITER because data can change node status */
NG_NODE_FORCE_WRITER(sc->node);
@@ -228,7 +230,7 @@ out:
static int
ng_h4_close(struct tty *tp, int flag)
{
- ng_h4_info_p sc = (ng_h4_info_p) tp->t_sc;
+ ng_h4_info_p sc = (ng_h4_info_p) tp->t_lsc;
int s;
s = spltty(); /* XXX */
@@ -236,7 +238,7 @@ ng_h4_close(struct tty *tp, int flag)
ttyflush(tp, FREAD | FWRITE);
clist_free_cblocks(&tp->t_outq);
if (sc != NULL) {
- tp->t_sc = NULL;
+ tp->t_lsc = NULL;
if (sc->node != NULL) {
if (sc->flags & NG_H4_TIMEOUT)
@@ -285,7 +287,7 @@ static int
ng_h4_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag,
struct thread *td)
{
- ng_h4_info_p sc = (ng_h4_info_p) tp->t_sc;
+ ng_h4_info_p sc = (ng_h4_info_p) tp->t_lsc;
int s, error = 0;
s = spltty(); /* XXX */
@@ -326,7 +328,7 @@ ng_h4_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag,
static int
ng_h4_input(int c, struct tty *tp)
{
- ng_h4_info_p sc = (ng_h4_info_p) tp->t_sc;
+ ng_h4_info_p sc = (ng_h4_info_p) tp->t_lsc;
if (sc == NULL || tp != sc->tp ||
sc->node == NULL || NG_NODE_NOT_VALID(sc->node))
@@ -546,7 +548,7 @@ ng_h4_input(int c, struct tty *tp)
static int
ng_h4_start(struct tty *tp)
{
- ng_h4_info_p sc = (ng_h4_info_p) tp->t_sc;
+ ng_h4_info_p sc = (ng_h4_info_p) tp->t_lsc;
if (sc == NULL || tp != sc->tp ||
sc->node == NULL || NG_NODE_NOT_VALID(sc->node))
OpenPOWER on IntegriCloud