bluetooth: complete removal of ng_h4

The ng_h4 module was disconnected 13 years ago when the tty later was
locked by Ed. It completely fails to compile, and has a number of false
positives for Giant use. Remove it for lack of interest. Bluetooth has
largely (completely?) moved on from bluetooth over UART transport.

OK'd by:		emax
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D31846
This commit is contained in:
Warner Losh 2021-09-05 12:41:16 -06:00
parent 6a460811b3
commit 79a100e28e
12 changed files with 5 additions and 1517 deletions

View File

@ -40,6 +40,9 @@
# xargs -n1 | sort | uniq -d;
# done
# 20210929: Remove ng_h4
OLD_FILES+=usr/share/man/man4/ng_h4.4.gz
# 20210923: rename boot(9) to kern_reboot(9)
OLD_FILES+=usr/share/man/man9/boot.9.gz

View File

@ -353,7 +353,6 @@ MAN= aac.4 \
ng_frame_relay.4 \
ng_gif.4 \
ng_gif_demux.4 \
ng_h4.4 \
ng_hci.4 \
ng_hole.4 \
ng_hub.4 \

View File

@ -36,7 +36,7 @@
.\" $Whistle: netgraph.4,v 1.7 1999/01/28 23:54:52 julian Exp $
.\" $FreeBSD$
.\"
.Dd January 9, 2021
.Dd September 29, 2021
.Dt NETGRAPH 4
.Os
.Sh NAME
@ -1433,7 +1433,6 @@ common networking problems, solved using
.Xr ng_frame_relay 4 ,
.Xr ng_gif 4 ,
.Xr ng_gif_demux 4 ,
.Xr ng_h4 4 ,
.Xr ng_hci 4 ,
.Xr ng_hole 4 ,
.Xr ng_hub 4 ,

View File

@ -1,123 +0,0 @@
.\" Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $Id: ng_h4.4,v 1.2 2003/05/21 19:37:35 max Exp $
.\" $FreeBSD$
.\"
.Dd June 14, 2002
.Dt NG_H4 4
.Os
.Sh NAME
.Nm ng_h4
.Nd Netgraph node type that is also an H4 line discipline
.Sh SYNOPSIS
.In sys/types.h
.In netgraph/bluetooth/include/ng_h4.h
.Sh DESCRIPTION
The
.Nm h4
node type is both a persistent Netgraph node type and a H4 line
discipline.
It implements a Bluetooth HCI UART transport layer as
per chapter H4 of the Bluetooth Specification Book v1.1.
A new node is created when the corresponding line discipline,
.Dv H4DISC ,
is registered on a tty device (see
.Xr tty 4 ) .
.Pp
The node has a single hook called
.Dv hook .
Incoming bytes received on the tty device are re-assembled into
HCI frames (according to the length).
Full HCI frames are sent out on the hook.
HCI frames received on
.Dv hook
are transmitted out on the tty device.
No modification to the data is performed in either direction.
While the line discipline is installed on a tty, the normal
read and write operations are unavailable, returning
.Er EIO .
.Pp
Information about the node is available via the netgraph
.Xr ioctl 2
command
.Dv NGIOCGINFO .
This command returns a
.Vt "struct nodeinfo"
similar to the
.Dv NGM_NODEINFO
.Xr netgraph 4
control message.
.Sh HOOKS
This node type supports the following hooks:
.Bl -tag -width ".Va hook"
.It Va hook
single HCI frame contained in single
.Vt mbuf
structure.
.El
.Sh CONTROL MESSAGES
This node type supports the generic control messages, plus the following:
.Bl -tag -width foo
.It Dv NGM_H4_NODE_RESET
Reset the node.
.It Dv NGM_H4_NODE_GET_STATE
Returns current receiving state for the node.
.It Dv NGM_H4_NODE_GET_DEBUG
Returns an integer containing the current debug level for the node.
.It Dv NGM_H4_NODE_SET_DEBUG
This command takes an integer argument and sets current debug level
for the node.
.It Dv NGM_H4_NODE_GET_QLEN
Returns current length of outgoing queue for the node.
.It Dv NGM_H4_NODE_SET_QLEN
This command takes an integer argument and sets maximum length of
outgoing queue for the node.
.It Dv NGM_H4_NODE_GET_STAT
Returns various statistic information for the node, such as: number of
bytes (frames) sent, number of bytes (frames) received and number of
input (output) errors.
.It Dv NGM_H4_NODE_RESET_STAT
Reset all statistic counters to zero.
.El
.Sh SHUTDOWN
This node shuts down when the corresponding device is closed
(or the line discipline is uninstalled on the device).
.Sh SEE ALSO
.Xr ioctl 2 ,
.Xr netgraph 4 ,
.Xr tty 4 ,
.Xr ngctl 8
.Sh HISTORY
The
.Nm h4
node type was implemented in
.Fx 5.0 .
.Sh AUTHORS
.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com
.Sh BUGS
This node still uses
.Xr spltty 9
to lock tty layer.
This is wrong.

View File

@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd January 9, 2021
.Dd September 29, 2021
.Dt BLUETOOTH.DEVICE.CONF 5
.Os
.Sh NAME
@ -173,7 +173,6 @@ The
file should be used to specify configuration parameters overrides for the
second USB Bluetooth device.
.Sh SEE ALSO
.Xr ng_h4 4 ,
.Xr ng_hci 4 ,
.Xr ng_l2cap 4 ,
.Xr ng_ubt 4 ,

View File

@ -4253,7 +4253,6 @@ netgraph/atm/sscop/ng_sscop.c optional ngatm_sscop \
netgraph/atm/uni/ng_uni.c optional ngatm_uni \
compile-with "${NORMAL_C} -I$S/contrib/ngatm"
netgraph/bluetooth/common/ng_bluetooth.c optional netgraph_bluetooth
netgraph/bluetooth/drivers/h4/ng_h4.c optional netgraph_bluetooth_h4
netgraph/bluetooth/drivers/ubt/ng_ubt.c optional netgraph_bluetooth_ubt usb
netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c optional netgraph_bluetooth_ubt usb
netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c optional netgraph_bluetooth_ubtbcmfw usb

View File

@ -1,12 +0,0 @@
# $Id: Makefile,v 1.1 2002/11/24 20:40:04 max Exp $
# $FreeBSD$
.PATH: ${SRCTOP}/sys/netgraph/bluetooth/drivers/h4
CFLAGS+= -I${SRCTOP}/sys/netgraph/bluetooth/include \
-I${SRCTOP}/sys/netgraph/bluetooth/drivers/h4
KMOD= ng_h4
SRCS= ng_h4.c
.include <bsd.kmod.mk>

View File

@ -1,13 +0,0 @@
$Id: TODO,v 1.2 2004/08/23 18:08:15 max Exp $
$FreeBSD$
FIXME/TODO list
This is a list of open issues for H4 node
1) Locking/SMP
External code now uses ng_send_fn to inject data into Netgraph, but
i still use splXXX to lock tty level. this is wrong and should be
fixed!

File diff suppressed because it is too large Load Diff

View File

@ -1,125 +0,0 @@
/*
* ng_h4_prse.h
*/
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 2001 Maksim Yevmenkin <m_evmenkin@yahoo.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: ng_h4_prse.h,v 1.4 2005/10/31 17:57:43 max Exp $
* $FreeBSD$
*/
/***************************************************************************
***************************************************************************
** ng_parse definitions for the H4 node
***************************************************************************
***************************************************************************/
#ifndef _NETGRAPH_H4_PRSE_H_
#define _NETGRAPH_H4_PRSE_H_
/*
* H4 node command list
*/
/* Stat info */
static const struct ng_parse_struct_field ng_h4_stat_type_fields[] =
{
{ "pckts_recv", &ng_parse_uint32_type, },
{ "bytes_recv", &ng_parse_uint32_type, },
{ "pckts_sent", &ng_parse_uint32_type, },
{ "bytes_sent", &ng_parse_uint32_type, },
{ "oerrors", &ng_parse_uint32_type, },
{ "ierrors", &ng_parse_uint32_type, },
{ NULL, }
};
static const struct ng_parse_type ng_h4_stat_type = {
&ng_parse_struct_type,
&ng_h4_stat_type_fields
};
static const struct ng_cmdlist ng_h4_cmdlist[] = {
{
NGM_H4_COOKIE,
NGM_H4_NODE_RESET,
"reset",
NULL,
NULL
},
{
NGM_H4_COOKIE,
NGM_H4_NODE_GET_STATE,
"get_state",
NULL,
&ng_parse_uint16_type
},
{
NGM_H4_COOKIE,
NGM_H4_NODE_GET_DEBUG,
"get_debug",
NULL,
&ng_parse_uint16_type
},
{
NGM_H4_COOKIE,
NGM_H4_NODE_SET_DEBUG,
"set_debug",
&ng_parse_uint16_type,
NULL
},
{
NGM_H4_COOKIE,
NGM_H4_NODE_GET_QLEN,
"get_qlen",
NULL,
&ng_parse_int32_type
},
{
NGM_H4_COOKIE,
NGM_H4_NODE_SET_QLEN,
"set_qlen",
&ng_parse_int32_type,
NULL
},
{
NGM_H4_COOKIE,
NGM_H4_NODE_GET_STAT,
"get_stat",
NULL,
&ng_h4_stat_type
},
{
NGM_H4_COOKIE,
NGM_H4_NODE_RESET_STAT,
"reset_stat",
NULL,
NULL
},
{ 0, }
};
#endif /* ndef _NETGRAPH_H4_PRSE_H_ */

View File

@ -1,104 +0,0 @@
/*
* ng_h4_var.h
*/
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: ng_h4_var.h,v 1.5 2005/10/31 17:57:43 max Exp $
* $FreeBSD$
*
* Based on:
* ---------
*
* FreeBSD: src/sys/netgraph/ng_tty.h
* Author: Archie Cobbs <archie@freebsd.org>
*/
#ifndef _NETGRAPH_H4_VAR_H_
#define _NETGRAPH_H4_VAR_H_
/*
* Malloc declaration
*/
#ifndef NG_SEPARATE_MALLOC
MALLOC_DECLARE(M_NETGRAPH_H4);
#else
#define M_NETGRAPH_H4 M_NETGRAPH
#endif /* NG_SEPARATE_MALLOC */
/*
* Debug
*/
#define NG_H4_ALERT if (sc->debug >= NG_H4_ALERT_LEVEL) printf
#define NG_H4_ERR if (sc->debug >= NG_H4_ERR_LEVEL) printf
#define NG_H4_WARN if (sc->debug >= NG_H4_WARN_LEVEL) printf
#define NG_H4_INFO if (sc->debug >= NG_H4_INFO_LEVEL) printf
#define NG_H4_HIWATER 256 /* High water mark on output */
/*
* Per-node private info
*/
typedef struct ng_h4_info {
struct tty *tp; /* Terminal device */
node_p node; /* Netgraph node */
ng_h4_node_debug_ep debug; /* Debug level */
ng_h4_node_state_ep state; /* State */
ng_h4_node_stat_ep stat;
#define NG_H4_STAT_PCKTS_SENT(s) (s).pckts_sent ++
#define NG_H4_STAT_BYTES_SENT(s, n) (s).bytes_sent += (n)
#define NG_H4_STAT_PCKTS_RECV(s) (s).pckts_recv ++
#define NG_H4_STAT_BYTES_RECV(s, n) (s).bytes_recv += (n)
#define NG_H4_STAT_OERROR(s) (s).oerrors ++
#define NG_H4_STAT_IERROR(s) (s).ierrors ++
#define NG_H4_STAT_RESET(s) bzero(&(s), sizeof((s)))
struct ifqueue outq; /* Queue of outgoing mbuf's */
#define NG_H4_DEFAULTQLEN 12 /* XXX max number of mbuf's in outq */
#define NG_H4_LOCK(sc) IF_LOCK(&sc->outq)
#define NG_H4_UNLOCK(sc) IF_UNLOCK(&sc->outq)
#define NG_H4_IBUF_SIZE 1024 /* XXX must be big enough to hold full
frame */
u_int8_t ibuf[NG_H4_IBUF_SIZE]; /* Incoming data */
u_int32_t got; /* Number of bytes we have received */
u_int32_t want; /* Number of bytes we want to receive */
hook_p hook; /* Upstream hook */
struct callout timo; /* See man timeout(9) */
u_int8_t dying; /* are we dying? */
} ng_h4_info_t;
typedef ng_h4_info_t * ng_h4_info_p;
#endif /* _NETGRAPH_H4_VAR_H_ */

View File

@ -1,114 +0,0 @@
/*
* ng_h4.h
*/
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: ng_h4.h,v 1.1 2002/11/24 19:47:05 max Exp $
* $FreeBSD$
*
* Based on:
* ---------
*
* FreeBSD: src/sys/netgraph/ng_tty.h
* Author: Archie Cobbs <archie@freebsd.org>
*/
/*
* This file contains everything that application needs to know about
* Bluetooth HCI UART transport layer as per chapter H4 of the Bluetooth
* Specification Book v1.1.
*
* This file can be included by both kernel and userland applications.
*/
#ifndef _NETGRAPH_H4_H_
#define _NETGRAPH_H4_H_
/**************************************************************************
**************************************************************************
** Netgraph node hook name, type name and type cookie and commands
**************************************************************************
**************************************************************************/
/* Hook name */
#define NG_H4_HOOK "hook"
/* Node type name and magic cookie */
#define NG_H4_NODE_TYPE "h4"
#define NGM_H4_COOKIE 1013899512
/* Node states */
#define NG_H4_W4_PKT_IND 1 /* Waiting for packet indicator */
#define NG_H4_W4_PKT_HDR 2 /* Waiting for packet header */
#define NG_H4_W4_PKT_DATA 3 /* Waiting for packet data */
/* Debug levels */
#define NG_H4_ALERT_LEVEL 1
#define NG_H4_ERR_LEVEL 2
#define NG_H4_WARN_LEVEL 3
#define NG_H4_INFO_LEVEL 4
/**************************************************************************
**************************************************************************
** H4 node command/event parameters
**************************************************************************
**************************************************************************/
/* Reset node */
#define NGM_H4_NODE_RESET 1
/* Get node state (see states above) */
#define NGM_H4_NODE_GET_STATE 2
typedef u_int16_t ng_h4_node_state_ep;
/* Get/Set node debug level (see levels above) */
#define NGM_H4_NODE_GET_DEBUG 3
#define NGM_H4_NODE_SET_DEBUG 4
typedef u_int16_t ng_h4_node_debug_ep;
/* Get/Set max queue length for the node */
#define NGM_H4_NODE_GET_QLEN 5
#define NGM_H4_NODE_SET_QLEN 6
typedef int32_t ng_h4_node_qlen_ep;
/* Get node statistic */
#define NGM_H4_NODE_GET_STAT 7
typedef struct {
u_int32_t pckts_recv; /* # of packets received */
u_int32_t bytes_recv; /* # of bytes received */
u_int32_t pckts_sent; /* # of packets sent */
u_int32_t bytes_sent; /* # of bytes sent */
u_int32_t oerrors; /* # of output errors */
u_int32_t ierrors; /* # of input errors */
} ng_h4_node_stat_ep;
/* Reset node statistic */
#define NGM_H4_NODE_RESET_STAT 8
#endif /* _NETGRAPH_H4_H_ */