Deleted Added
full compact
bluetooth (165664) bluetooth (165683)
1#!/bin/sh
2#
3# Copyright (c) 2005 Maksim Yevmenkin <m_evmenkin@yahoo.com>
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:

--- 10 unchanged lines hidden (view full) ---

19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
1#!/bin/sh
2#
3# Copyright (c) 2005 Maksim Yevmenkin <m_evmenkin@yahoo.com>
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:

--- 10 unchanged lines hidden (view full) ---

19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
27# $FreeBSD: head/etc/rc.d/bluetooth 165664 2006-12-30 22:53:20Z yar $
27# $FreeBSD: head/etc/rc.d/bluetooth 165683 2006-12-31 10:37:18Z yar $
28
29# PROVIDE: bluetooth
30# REQUIRE: DAEMON
31# KEYWORD: nojail nostart
32
33. /etc/rc.subr
34
35name="bluetooth"
36rcvar=
37start_cmd="bluetooth_start"
38stop_cmd="bluetooth_stop"
28
29# PROVIDE: bluetooth
30# REQUIRE: DAEMON
31# KEYWORD: nojail nostart
32
33. /etc/rc.subr
34
35name="bluetooth"
36rcvar=
37start_cmd="bluetooth_start"
38stop_cmd="bluetooth_stop"
39required_modules="ng_bluetooth ng_hci ng_l2cap ng_btsocket"
39
40##############################################################################
41# Read and parse Bluetooth device configuration file
42##############################################################################
43
44bluetooth_read_conf()
45{
46 local _err _file _line _namespace

--- 179 unchanged lines hidden (view full) ---

226##############################################################################
227
228bluetooth_start()
229{
230 local _file
231
232 dev=$1
233
40
41##############################################################################
42# Read and parse Bluetooth device configuration file
43##############################################################################
44
45bluetooth_read_conf()
46{
47 local _err _file _line _namespace

--- 179 unchanged lines hidden (view full) ---

227##############################################################################
228
229bluetooth_start()
230{
231 local _file
232
233 dev=$1
234
234 # Automatically load modules
235 kldload ng_bluetooth > /dev/null 2>&1
236 kldload ng_hci > /dev/null 2>&1
237 kldload ng_l2cap > /dev/null 2>&1
238 kldload ng_btsocket > /dev/null 2>&1
239
240 # Try to figure out device type by looking at device name
241 case "${dev}" in
242 # sioX - serial/UART Bluetooth device
243 sio*)
235 # Try to figure out device type by looking at device name
236 case "${dev}" in
237 # sioX - serial/UART Bluetooth device
238 sio*)
244 kldload ng_h4 > /dev/null 2>&1
239 load_kld ng_h4 || return 1
245
246 hook="hook"
247
248 # Obtain unit number from device.
249 unit=`expr ${dev} : 'sio\([0-9]\{1,\}\)'`
250 if [ -z "${unit}" ]; then
251 err 1 "Unable to get sio unit number: ${dev}"
252 fi

--- 118 unchanged lines hidden ---
240
241 hook="hook"
242
243 # Obtain unit number from device.
244 unit=`expr ${dev} : 'sio\([0-9]\{1,\}\)'`
245 if [ -z "${unit}" ]; then
246 err 1 "Unable to get sio unit number: ${dev}"
247 fi

--- 118 unchanged lines hidden ---