Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jun 2002 07:46:45 -0400 (EDT)
From:      Bryan Liesner <bleez@bellatlantic.net>
To:        freebsd-stable@freebsd.org
Subject:   D-Link DSB-R100 and the ufm driver
Message-ID:  <20020625073327.D708-200000@gravy.kishka.net>

next in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--0-1713206580-1025005605=:708
Content-Type: TEXT/PLAIN; charset=US-ASCII


I just finished compiling ufm support into the kernel, and grabbed
NetBSD's dsbr100 port to control my DSB-R100 device.  With a little
tweaking I got the port to compile, but when I run it I get
inappropriate ioctl errors for USB_GET_DEVICEINFO and
USB_DO_REQUEST.

I think the device node may be wrong but here's what I have:
crw-r--r--  1 root  operator  200,   0 Jun 25 00:55 /dev/ufm0
dmesg shows:
ufm0: GemTek Corp USB FM Radio, rev 1.00/4.10, addr 2

I'm definitely not a USB guru, and need a bit of help getting this
thing to work.  The source is small enough, so it's attached.

Thanks!

==========================================================
= Bryan D. Liesner         LeezSoft Communications, Inc. =
=                          A subsidiary of LeezSoft Inc. =
= bleez@bellatlantic.net   Home of the Gipper            =
==========================================================

--0-1713206580-1025005605=:708
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="dsbr100.c"
Content-Transfer-Encoding: BASE64
Content-ID: <20020625074645.T708@gravy.kishka.net>
Content-Description: 
Content-Disposition: attachment; filename="dsbr100.c"

LyoNCiAqIENvcHlyaWdodCAoYykgMjAwMCBMZW5uYXJ0IEF1Z3VzdHNzb24g
PGF1Z3VzdHNzQG5ldGJzZC5vcmc+DQogKiBBbGwgcmlnaHRzIHJlc2VydmVk
Lg0KICoNCiAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFu
ZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dA0KICogbW9kaWZpY2F0
aW9uLCBhcmUgcGVyb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MF0sICJz
ZWFyY2giKSA9PSAwICYmDQoJCSBzc2NhbmYoYXJndlsxXSwgIiVsZiIsICZs
bykgPT0gMSAmJg0KCQkgc3NjYW5mKGFyZ3ZbMl0sICIlbGYiLCAmaGkpID09
IDEpIHsNCgkJc2NhbihmLCBsbyAqIDEwMDAsIGhpICogMTAwMCwgMCk7DQoJ
fSBlbHNlIGlmIChhcmdjID09IDEgJiYgc3RyY21wKGFyZ3ZbMF0sICJzdGF0
dXMiKSA9PSAwKQ0KCQlwcmludGYoIiVzXG4iLCByYWRpb19zdGF0dXMoZikg
PyAic3RlcmVvIiA6ICJtb25vIik7DQoJZWxzZQ0KCQl1c2FnZSgpOw0KDQoJ
Y2xvc2UoZik7DQoNCglleGl0KDApOw0KfQ0K
--0-1713206580-1025005605=:708--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020625073327.D708-200000>