FreeBSD kernel usb device Code
|
#include <sys/stdint.h>
#include <sys/stddef.h>
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/types.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/bus.h>
#include <sys/module.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/condvar.h>
#include <sys/sysctl.h>
#include <sys/sx.h>
#include <sys/unistd.h>
#include <sys/callout.h>
#include <sys/malloc.h>
#include <sys/priv.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usb_core.h>
#include <dev/usb/usb_cdc.h>
#include <dev/usb/usb_ioctl.h>
#include <dev/usb/usb_util.h>
#include <dev/usb/template/usb_template.h>
Go to the source code of this file.
Macros | |
#define | PHONE_DEFAULT_VENDOR_ID USB_TEMPLATE_VENDOR |
#define | PHONE_DEFAULT_PRODUCT_ID 0x05dc |
#define | PHONE_DEFAULT_MIXER "Mixer interface" |
#define | PHONE_DEFAULT_RECORD "Record interface" |
#define | PHONE_DEFAULT_PLAYBACK "Playback interface" |
#define | PHONE_DEFAULT_HID "HID interface" |
#define | PHONE_DEFAULT_MANUFACTURER USB_TEMPLATE_MANUFACTURER |
#define | PHONE_DEFAULT_PRODUCT "USB Phone Device" |
#define | PHONE_DEFAULT_SERIAL_NUMBER "March 2008" |
Enumerations | |
enum | { PHONE_LANG_INDEX , PHONE_MIXER_INDEX , PHONE_RECORD_INDEX , PHONE_PLAYBACK_INDEX , PHONE_HID_INDEX , PHONE_MANUFACTURER_INDEX , PHONE_PRODUCT_INDEX , PHONE_SERIAL_NUMBER_INDEX , PHONE_MAX_INDEX } |
Functions | |
static const void * | phone_get_vendor_desc (const struct usb_device_request *req, uint16_t *plen) |
static const void * | phone_get_string_desc (uint16_t lang_id, uint8_t string_index) |
static void | phone_init (void *arg __unused) |
static void | phone_uninit (void *arg __unused) |
SYSINIT (phone_init, SI_SUB_LOCK, SI_ORDER_FIRST, phone_init, NULL) | |
SYSUNINIT (phone_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, phone_uninit, NULL) | |
#define PHONE_DEFAULT_HID "HID interface" |
Definition at line 87 of file usb_template_phone.c.
#define PHONE_DEFAULT_MANUFACTURER USB_TEMPLATE_MANUFACTURER |
Definition at line 88 of file usb_template_phone.c.
#define PHONE_DEFAULT_MIXER "Mixer interface" |
Definition at line 84 of file usb_template_phone.c.
#define PHONE_DEFAULT_PLAYBACK "Playback interface" |
Definition at line 86 of file usb_template_phone.c.
#define PHONE_DEFAULT_PRODUCT "USB Phone Device" |
Definition at line 89 of file usb_template_phone.c.
#define PHONE_DEFAULT_PRODUCT_ID 0x05dc |
Definition at line 83 of file usb_template_phone.c.
#define PHONE_DEFAULT_RECORD "Record interface" |
Definition at line 85 of file usb_template_phone.c.
#define PHONE_DEFAULT_SERIAL_NUMBER "March 2008" |
Definition at line 90 of file usb_template_phone.c.
#define PHONE_DEFAULT_VENDOR_ID USB_TEMPLATE_VENDOR |
Definition at line 82 of file usb_template_phone.c.
anonymous enum |
Enumerator | |
---|---|
PHONE_LANG_INDEX | |
PHONE_MIXER_INDEX | |
PHONE_RECORD_INDEX | |
PHONE_PLAYBACK_INDEX | |
PHONE_HID_INDEX | |
PHONE_MANUFACTURER_INDEX | |
PHONE_PRODUCT_INDEX | |
PHONE_SERIAL_NUMBER_INDEX | |
PHONE_MAX_INDEX |
Definition at line 70 of file usb_template_phone.c.
|
static |
Definition at line 405 of file usb_template_phone.c.
References phone_hid, PHONE_HID_INDEX, PHONE_LANG_INDEX, phone_manufacturer, PHONE_MANUFACTURER_INDEX, PHONE_MAX_INDEX, phone_mixer, PHONE_MIXER_INDEX, phone_playback, PHONE_PLAYBACK_INDEX, phone_product, PHONE_PRODUCT_INDEX, phone_record, PHONE_RECORD_INDEX, phone_serial_number, PHONE_SERIAL_NUMBER_INDEX, and usb_string_lang_en.
|
static |
Definition at line 386 of file usb_template_phone.c.
References phone_hid_descriptor, plen, and req.
|
static |
Definition at line 431 of file usb_template_phone.c.
References usb_temp_device_desc::idProduct, usb_temp_device_desc::idVendor, phone_ctx_list, PHONE_DEFAULT_HID, PHONE_DEFAULT_MANUFACTURER, PHONE_DEFAULT_MIXER, PHONE_DEFAULT_PLAYBACK, PHONE_DEFAULT_PRODUCT, PHONE_DEFAULT_RECORD, PHONE_DEFAULT_SERIAL_NUMBER, phone_hid, phone_manufacturer, phone_mixer, phone_playback, phone_product, phone_record, phone_serial_number, usb_make_str_desc(), USB_TEMP_PHONE, usb_temp_sysctl(), and usb_template_cdce.
|
static |
Definition at line 497 of file usb_template_phone.c.
References phone_ctx_list.
SYSINIT | ( | phone_init | , |
SI_SUB_LOCK | , | ||
SI_ORDER_FIRST | , | ||
phone_init | , | ||
NULL | |||
) |
SYSUNINIT | ( | phone_uninit | , |
SI_SUB_LOCK | , | ||
SI_ORDER_FIRST | , | ||
phone_uninit | , | ||
NULL | |||
) |
|
static |
Definition at line 348 of file usb_template_phone.c.
|
static |
Definition at line 355 of file usb_template_phone.c.
|
static |
Definition at line 100 of file usb_template_phone.c.
Referenced by phone_init(), and phone_uninit().
|
static |
Definition at line 360 of file usb_template_phone.c.
|
static |
Definition at line 361 of file usb_template_phone.c.
|
static |
Definition at line 95 of file usb_template_phone.c.
Referenced by phone_get_string_desc(), and phone_init().
|
static |
Definition at line 302 of file usb_template_phone.c.
|
static |
Definition at line 110 of file usb_template_phone.c.
Referenced by phone_get_vendor_desc().
|
static |
Definition at line 317 of file usb_template_phone.c.
|
static |
Definition at line 312 of file usb_template_phone.c.
|
static |
Definition at line 307 of file usb_template_phone.c.
|
static |
Definition at line 297 of file usb_template_phone.c.
|
static |
Definition at line 164 of file usb_template_phone.c.
|
static |
Definition at line 221 of file usb_template_phone.c.
|
static |
Definition at line 230 of file usb_template_phone.c.
|
static |
Definition at line 216 of file usb_template_phone.c.
|
static |
Definition at line 278 of file usb_template_phone.c.
|
static |
Definition at line 287 of file usb_template_phone.c.
|
static |
Definition at line 273 of file usb_template_phone.c.
|
static |
Definition at line 329 of file usb_template_phone.c.
|
static |
Definition at line 324 of file usb_template_phone.c.
|
static |
Definition at line 338 of file usb_template_phone.c.
|
static |
Definition at line 208 of file usb_template_phone.c.
|
static |
Definition at line 203 of file usb_template_phone.c.
|
static |
Definition at line 198 of file usb_template_phone.c.
|
static |
Definition at line 265 of file usb_template_phone.c.
|
static |
Definition at line 96 of file usb_template_phone.c.
Referenced by phone_get_string_desc(), and phone_init().
|
static |
Definition at line 92 of file usb_template_phone.c.
Referenced by phone_get_string_desc(), and phone_init().
|
static |
Definition at line 94 of file usb_template_phone.c.
Referenced by phone_get_string_desc(), and phone_init().
|
static |
Definition at line 97 of file usb_template_phone.c.
Referenced by phone_get_string_desc(), and phone_init().
|
static |
Definition at line 118 of file usb_template_phone.c.
|
static |
Definition at line 123 of file usb_template_phone.c.
|
static |
Definition at line 128 of file usb_template_phone.c.
|
static |
Definition at line 173 of file usb_template_phone.c.
|
static |
Definition at line 177 of file usb_template_phone.c.
|
static |
Definition at line 183 of file usb_template_phone.c.
|
static |
Definition at line 133 of file usb_template_phone.c.
|
static |
Definition at line 240 of file usb_template_phone.c.
|
static |
Definition at line 244 of file usb_template_phone.c.
|
static |
Definition at line 250 of file usb_template_phone.c.
|
static |
Definition at line 138 of file usb_template_phone.c.
|
static |
Definition at line 143 of file usb_template_phone.c.
|
static |
Definition at line 148 of file usb_template_phone.c.
|
static |
Definition at line 193 of file usb_template_phone.c.
|
static |
Definition at line 260 of file usb_template_phone.c.
|
static |
Definition at line 153 of file usb_template_phone.c.
|
static |
Definition at line 187 of file usb_template_phone.c.
|
static |
Definition at line 254 of file usb_template_phone.c.
|
static |
Definition at line 93 of file usb_template_phone.c.
Referenced by phone_get_string_desc(), and phone_init().
|
static |
Definition at line 98 of file usb_template_phone.c.
Referenced by phone_get_string_desc(), and phone_init().
struct usb_temp_device_desc usb_template_phone |
Definition at line 363 of file usb_template_phone.c.
Referenced by usb_temp_setup_by_index().