xref: /freebsd/libexec/rc/rc.d/ubthidhci (revision cab6a39d7b343596a5823e65c0f7b426551ec22d)
1#!/bin/sh
2#
3# $FreeBSD$
4#
5
6# PROVIDE: ubthidhci
7# REQUIRE: DAEMON
8# BEFORE: bluetooth
9# KEYWORD: nojail shutdown
10
11. /etc/rc.subr
12
13name="ubthidhci"
14rcvar="ubthidhci_enable"
15command="/usr/sbin/usbconfig"
16start_precmd="ubthidhci_prestart"
17
18ubthidhci_prestart()
19{
20
21	if [ -z ${ubthidhci_busnum} ]; then
22		warn ubthidhci_busnum is not set
23		return 1
24	fi
25	if [ -z ${ubthidhci_addr} ]; then
26		warn ubthidhci_addr is not set
27		return 1
28	fi
29}
30
31load_rc_config $name
32#
33# We discard the output because:
34# 1) we don't want it to show up during boot; and
35# 2) the request usually returns an error, but that doesn't mean it failed
36#
37# NB: 0x40 is UT_VENDOR
38command_args="-u ${ubthidhci_busnum} -a ${ubthidhci_addr} do_request 0x40 0 0 0 0 > /dev/null 2>&1"
39
40run_rc_command "$1"
41