ng_h4.c (151387) | ng_h4.c (164033) |
---|---|
1/* 2 * ng_h4.c 3 */ 4 5/*- 6 * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com> 7 * All rights reserved. 8 * --- 14 unchanged lines hidden (view full) --- 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * 30 * $Id: ng_h4.c,v 1.7 2004/08/23 18:08:15 max Exp $ | 1/* 2 * ng_h4.c 3 */ 4 5/*- 6 * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com> 7 * All rights reserved. 8 * --- 14 unchanged lines hidden (view full) --- 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * 30 * $Id: ng_h4.c,v 1.7 2004/08/23 18:08:15 max Exp $ |
31 * $FreeBSD: head/sys/netgraph/bluetooth/drivers/h4/ng_h4.c 151387 2005-10-16 20:44:18Z phk $ | 31 * $FreeBSD: head/sys/netgraph/bluetooth/drivers/h4/ng_h4.c 164033 2006-11-06 13:42:10Z rwatson $ |
32 * 33 * Based on: 34 * --------- 35 * 36 * FreeBSD: src/sys/netgraph/ng_tty.c 37 * Author: Archie Cobbs <archie@freebsd.org> 38 * 39 */ 40 41#include <sys/param.h> 42#include <sys/systm.h> 43#include <sys/kernel.h> 44#include <sys/conf.h> 45#include <sys/endian.h> 46#include <sys/errno.h> 47#include <sys/fcntl.h> 48#include <sys/ioccom.h> 49#include <sys/malloc.h> 50#include <sys/mbuf.h> | 32 * 33 * Based on: 34 * --------- 35 * 36 * FreeBSD: src/sys/netgraph/ng_tty.c 37 * Author: Archie Cobbs <archie@freebsd.org> 38 * 39 */ 40 41#include <sys/param.h> 42#include <sys/systm.h> 43#include <sys/kernel.h> 44#include <sys/conf.h> 45#include <sys/endian.h> 46#include <sys/errno.h> 47#include <sys/fcntl.h> 48#include <sys/ioccom.h> 49#include <sys/malloc.h> 50#include <sys/mbuf.h> |
51#include <sys/priv.h> |
|
51#include <sys/tty.h> 52#include <sys/ttycom.h> 53#include <netgraph/ng_message.h> 54#include <netgraph/netgraph.h> 55#include <netgraph/ng_parse.h> 56#include <netgraph/bluetooth/include/ng_bluetooth.h> 57#include <netgraph/bluetooth/include/ng_hci.h> 58#include <netgraph/bluetooth/include/ng_h4.h> --- 92 unchanged lines hidden (view full) --- 151static int 152ng_h4_open(struct cdev *dev, struct tty *tp) 153{ 154 char name[NG_NODESIZ]; 155 ng_h4_info_p sc = NULL; 156 int s, error; 157 158 /* Super-user only */ | 52#include <sys/tty.h> 53#include <sys/ttycom.h> 54#include <netgraph/ng_message.h> 55#include <netgraph/netgraph.h> 56#include <netgraph/ng_parse.h> 57#include <netgraph/bluetooth/include/ng_bluetooth.h> 58#include <netgraph/bluetooth/include/ng_hci.h> 59#include <netgraph/bluetooth/include/ng_h4.h> --- 92 unchanged lines hidden (view full) --- 152static int 153ng_h4_open(struct cdev *dev, struct tty *tp) 154{ 155 char name[NG_NODESIZ]; 156 ng_h4_info_p sc = NULL; 157 int s, error; 158 159 /* Super-user only */ |
159 error = suser(curthread); /* XXX */ | 160 error = priv_check(curthread, PRIV_NETGRAPH_TTY); /* XXX */ |
160 if (error != 0) 161 return (error); 162 163 s = splnet(); /* XXX */ 164 spltty(); /* XXX */ 165 166 /* Initialize private struct */ 167 MALLOC(sc, ng_h4_info_p, sizeof(*sc), M_NETGRAPH_H4, M_NOWAIT|M_ZERO); --- 867 unchanged lines hidden --- | 161 if (error != 0) 162 return (error); 163 164 s = splnet(); /* XXX */ 165 spltty(); /* XXX */ 166 167 /* Initialize private struct */ 168 MALLOC(sc, ng_h4_info_p, sizeof(*sc), M_NETGRAPH_H4, M_NOWAIT|M_ZERO); --- 867 unchanged lines hidden --- |