From owner-freebsd-usb@FreeBSD.ORG Sun Nov 22 20:09:05 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74FE5106566B for ; Sun, 22 Nov 2009 20:09:05 +0000 (UTC) (envelope-from sasha.devel@gmail.com) Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by mx1.freebsd.org (Postfix) with ESMTP id F29338FC08 for ; Sun, 22 Nov 2009 20:09:04 +0000 (UTC) Received: by fxm10 with SMTP id 10so2332992fxm.14 for ; Sun, 22 Nov 2009 12:09:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=pKr2ZTWHtX0ZJkjhlM0oV3tna6GWb5mAYuXjIobwkIQ=; b=YpS2udgX53prvzf1Qs5+sSoPW6Es1Sn8f7UAHZWw4wpp0azCpl1AS6i8am/1TQWyOE /NsyrTXViGkdW4XDtvViGL6SNYM58ZyTmJaRKl10LT/pvJZLnBRAYzk49698AHpz044z AvyA6iAksydkJbc5WPbCtV+N3fXu3r2pXH3zI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=fXb5AItqG8l72qducg0HKLRfUJTeWDjiyEWqqAX+YKnjbgfNx+XQGtWk1afeumYPAW DzO1omY4e/6Vs+dKxry6bpOiCneFdwebPIRGsaDrJf+2jdRzc8WoVBbubegKxDO9klho jyB8DS4B00boMhjKbLlLZe7NMch8HysX9OgaE= Received: by 10.103.21.24 with SMTP id y24mr1815318mui.110.1258920539444; Sun, 22 Nov 2009 12:08:59 -0800 (PST) Received: from ?192.168.1.1? ([94.253.80.54]) by mx.google.com with ESMTPS id w5sm13746547mue.22.2009.11.22.12.08.57 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 22 Nov 2009 12:08:58 -0800 (PST) Message-ID: <4B099A50.9000006@gmail.com> Date: Sun, 22 Nov 2009 23:08:48 +0300 From: Alexander Samarin User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: freebsd-usb@freebsd.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: usb ethernet driver question X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 20:09:05 -0000 Hello, all! I'm trying to write a kernel module driver for WiMAX modem. I have Samsung SWC-U100 USB modem. Driver is based on if_cue module (it's source file is smallest in the tree). I've get module successfully attaching to device and registering new network interface, but some questions appeared: 1. madwimax project have a description of protocol of the modem, but it says simply "This data should be sent over OUT endpoint in bulk mode." In other drivers I found only calls to functionu ether_do_request() e.g: struct usb_device_request req; req.bmRequestType = UT_READ_VENDOR_DEVICE; req.bRequest = CUE_CMD_GET_MACADDR; USETW(req.wValue, 0); USETW(req.wIndex, 0); USETW(req.wLength, ETHER_ADDR_LEN); uether_do_request(&sc->sc_ue, &req, buf, 1000); Here I can't understand: Buffer can be sent or received via buf argument of ether_do_request(), but what value should be used for req.bRequest, req.wValue and req.wIndex fields? In dev/usb/net/if_* files drivers read and write to registers or memory of chip; libusb just writes to file descriptor. Can anyone take me a link where I can read more about programming usb drivers for kernel? 2. Is it possible to detach CAM subsystem from virtual DVD-ROM on other interface? This DVD-ROM contains WinXP drivers and access program, which will never be used (I think) on UNIX systems. PS: I know that if_cue is an ethernet driver, but WiMAX is a wireless so basing driver on if_cue code is not a good idea, but wireless drivers are big and my modem can connect only to one provider (Yota) so I decided to use if_cue as base code. PS2: sorry for my English. -- Best regards, Alexander Samarin mailto:sasha at enikasoft.ru https://www.fsora.ru (waits for FreeBSD 8.0-RELEASE)