File: functions.sgml

package info (click to toggle)
libusb 2%3A0.1.12-13
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,172 kB
  • ctags: 483
  • sloc: sh: 8,374; ansic: 2,626; cpp: 960; makefile: 225
file content (540 lines) | stat: -rw-r--r-- 25,786 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
  <title>Functions</title>

  <reference id="ref.core">
    <title>Core</title>
    <partintro>
      <!-- FIXME: Check spelling of "comprise" -->
      <para>These functions comprise the core of libusb. They are used by all applications that utilize libusb.</para>
    </partintro>

    <refentry id="function.usbinit">
      <refnamediv>
        <refname>usb_init</refname>
        <refpurpose>Initialize libusb</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>void <function>usb_init</function></funcdef>
            <void>
          </funcprototype>
        </funcsynopsis>
        <para>Just like the name implies, <function>usb_init</function> sets up some internal structures. <function>usb_init</function> <emphasis>must</emphasis> be called before any other libusb functions.</para>
      </refsect1>
    </refentry>

    <refentry id="function.usbfindbusses">
      <refnamediv>
        <refname>usb_find_busses</refname>
        <refpurpose>Finds all USB busses on system</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>int <function>usb_find_busses</function></funcdef>
            <void>
          </funcprototype>
        </funcsynopsis>
        <para><function>usb_find_busses</function> will find all of the busses on the system. Returns the number of changes since previous call to this function (total of new busses and busses removed).</para>
      </refsect1>
    </refentry>

    <refentry id="function.usbfinddevices">
      <refnamediv>
        <refname>usb_find_devices</refname>
        <refpurpose>Find all devices on all USB devices</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>int <function>usb_find_devices</function></funcdef>
            <void>
          </funcprototype>
        </funcsynopsis>
        <para><function>usb_find_devices</function> will find all of the devices on each bus. This should be called after <xref linkend="function.usbfindbusses">. Returns the number of changes since the previous call to this function (total of new device and devices removed).</para>
      </refsect1>
    </refentry>

    <refentry id="function.usbgetbusses">
      <refnamediv>
        <refname>usb_get_busses</refname>
        <refpurpose>Return the list of USB busses found</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>struct usb_bus *<function>usb_get_busses</function></funcdef>
            <void>
          </funcprototype>
        </funcsynopsis>
        <para><function>usb_get_busses</function> simply returns the value of the global variable <varname>usb_busses</varname>. This was implemented for those languages that support C calling convention and can use shared libraries, but don't support C global variables (like Delphi).</para>
      </refsect1>
    </refentry>
  </reference>

  <reference id="ref.deviceops">
    <title>Device operations</title>
    <partintro>
      <para>This group of functions deal with the device. It allows you to open and close the device as well standard USB operations like setting the configuration, alternate settings, clearing halts and resetting the device. It also provides OS level operations such as claiming and releasing interfaces.</para>
    </partintro>

    <refentry id="function.usbopen">
      <refnamediv>
        <refname>usb_open</refname>
        <refpurpose>Opens a USB device</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>usb_dev_handle *<function>usb_open</function></funcdef>
            <paramdef>struct *usb_device <parameter>dev</parameter></paramdef>
          </funcprototype>
        </funcsynopsis>
        <para><function>usb_open</function> is to be used to open up a device for use. <function>usb_open</function> must be called before attempting to perform any operations to the device. Returns a handle used in future communication with the device.</para>
      </refsect1>
    </refentry>

    <refentry id="function.usbclose">
      <refnamediv>
        <refname>usb_close</refname>
        <refpurpose>Closes a USB device</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>int <function>usb_close</function></funcdef>
            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
          </funcprototype>
        </funcsynopsis>
        <para><function>usb_close</function> closes a device opened with <xref linkend="function.usbopen">. No further operations may be performed on the handle after <function>usb_close</function> is called. Returns 0 on success or &lt; 0 on error.</para>
      </refsect1>
    </refentry>

    <refentry id="function.usbsetconfiguration">
      <refnamediv>
        <refname>usb_set_configuration</refname>
        <refpurpose>Sets the active configuration of a device</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>int <function>usb_set_configuration</function></funcdef>
            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
            <paramdef>int <parameter>configuration</parameter></paramdef>
          </funcprototype>
        </funcsynopsis>
        <para><function>usb_set_configuration</function> sets the active configuration of a device. The <varname>configuration</varname> parameter is the value as specified in the descriptor field bConfigurationValue. Returns 0 on success or &lt; 0 on error.</para>
      </refsect1>
    </refentry>

    <refentry id="function.usbsetaltinterface">
      <refnamediv>
        <refname>usb_set_altinterface</refname>
        <refpurpose>Sets the active alternate setting of the current interface</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>int <function>usb_set_altinterface</function></funcdef>
            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
            <paramdef>int <parameter>alternate</parameter></paramdef>
          </funcprototype>
        </funcsynopsis>
        <para><function>usb_set_altinterface</function> sets the active alternate setting of the current interface. The <varname>alternate</varname> parameter is the value as specified in the descriptor field bAlternateSetting. Returns 0 on success or &lt; 0 on error.</para>
      </refsect1>
    </refentry>

    <refentry id="function.usbresetep">
      <refnamediv>
        <refname>usb_resetep</refname>
        <refpurpose>Resets state for an endpoint</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>int <function>usb_resetep</function></funcdef>
            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
            <paramdef>unsigned int <parameter>ep</parameter></paramdef>
          </funcprototype>
        </funcsynopsis>
        <para><function>usb_resetep</function> resets all state (like toggles) for the specified endpoint. The <varname>ep</varname> parameter is the value specified in the descriptor field bEndpointAddress. Returns 0 on success or &lt; 0 on error.</para>
        <note>
          <title>Deprecated</title>
          <para><function>usb_resetep</function> is deprecated. You probably want to use <xref linkend="function.usbclearhalt">.</para>
        </note>
      </refsect1>
    </refentry>

    <refentry id="function.usbclearhalt">
      <refnamediv>
        <refname>usb_clear_halt</refname>
        <refpurpose>Clears any halt status on an endpoint</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>int <function>usb_clear_halt</function></funcdef>
            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
            <paramdef>unsigned int <parameter>ep</parameter></paramdef>
          </funcprototype>
        </funcsynopsis>
        <para><function>usb_clear_halt</function> clears any halt status on the specified endpoint. The <varname>ep</varname> parameter is the value specified in the descriptor field bEndpointAddress. Returns 0 on success or &lt; 0 on error.</para>
      </refsect1>
    </refentry>

    <refentry id="function.usbreset">
      <refnamediv>
        <refname>usb_reset</refname>
        <refpurpose>Resets a device</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>int <function>usb_reset</function></funcdef>
            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
          </funcprototype>
        </funcsynopsis>
        <para><function>usb_reset</function> resets the specified device by sending a RESET down the port it is connected to. Returns 0 on success or &lt; 0 on error.</para>
        <note>
          <title>Causes re-enumeration</title>
          <para>After calling <function>usb_reset</function>, the device will need to re-enumerate and thusly, requires you to find the new device and open a new handle. The handle used to call <function>usb_reset</function> will no longer work.</para>
        </note>
      </refsect1>
    </refentry>

    <refentry id="function.usbclaiminterface">
      <refnamediv>
        <refname>usb_claim_interface</refname>
        <refpurpose>Claim an interface of a device</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>int <function>usb_claim_interface</function></funcdef>
            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
            <paramdef>int <parameter>interface</parameter></paramdef>
          </funcprototype>
        </funcsynopsis>
        <para><function>usb_claim_interface</function> claims the interface with the Operating System. The interface parameter is the value as specified in the descriptor field bInterfaceNumber. Returns 0 on success or &lt; 0 on error.</para>
        <important>
          <title>Must be called!</title>
          <para><function>usb_claim_interface</function> <emphasis>must</emphasis> be called before you perform any operations related to this interface (like <xref linkend="function.usbsetaltinterface">, <xref linkend="function.usbbulkwrite">, etc).</para>
        </important>

        <table>
          <title>Return Codes</title>
          <tgroup cols="2">
            <thead>
              <row>
                <entry>code</entry>
                <entry>description</entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry>-EBUSY</entry>
                <entry>Interface is not available to be claimed</entry>
              </row>
              <row>
                <entry>-ENOMEM</entry>
                <entry>Insufficient memory</entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </refsect1>
    </refentry>

    <refentry id="function.usbreleaseinterface">
      <refnamediv>
        <refname>usb_release_interface</refname>
        <refpurpose>Releases a previously claimed interface</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>int <function>usb_release_interface</function></funcdef>
            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
            <paramdef>int <parameter>interface</parameter></paramdef>
          </funcprototype>
        </funcsynopsis>
        <para><function>usb_release_interface</function> releases an interface previously claimed with <xref linkend="function.usbclaiminterface">. The interface parameter is the value as specified in the descriptor field bInterfaceNumber. Returns 0 on success or &lt; 0 on error.</para>
      </refsect1>
    </refentry>
  </reference>

  <reference id="ref.control">
    <title>Control Transfers</title>
    <partintro>
      <para>This group of functions allow applications to send messages to the default control pipe.</para>
    </partintro>

    <refentry id="function.usbcontrolmsg">
      <refnamediv>
        <refname>usb_control_msg</refname>
        <refpurpose>Send a control message to a device</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>int <function>usb_control_msg</function></funcdef>
            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
            <paramdef>int <parameter>requesttype</parameter></paramdef>
            <paramdef>int <parameter>request</parameter></paramdef>
            <paramdef>int <parameter>value</parameter></paramdef>
            <paramdef>int <parameter>index</parameter></paramdef>
            <paramdef>char *<parameter>bytes</parameter></paramdef>
            <paramdef>int <parameter>size</parameter></paramdef>
            <paramdef>int <parameter>timeout</parameter></paramdef>
          </funcprototype>
        </funcsynopsis>
        <para><function>usb_control_msg</function> performs a control request to the default control pipe on a device. The parameters mirror the types of the same name in the USB specification. Returns number of bytes written/read or &lt; 0 on error.</para>
      </refsect1>
    </refentry>

    <refentry id="function.usbgetstring">
      <refnamediv>
        <refname>usb_get_string</refname>
        <refpurpose>Retrieves a string descriptor from a device</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>int <function>usb_get_string</function></funcdef>
            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
            <paramdef>int <parameter>index</parameter></paramdef>
            <paramdef>int <parameter>langid</parameter></paramdef>
            <paramdef>char *<parameter>buf</parameter></paramdef>
            <paramdef>size_t <parameter>buflen</parameter></paramdef>
          </funcprototype>
        </funcsynopsis>
        <para><function>usb_get_string</function> retrieves the string descriptor specified by index and langid from a device. The string will be returned in Unicode as specified by the USB specification. Returns the number of bytes returned in <varname>buf</varname> or &lt; 0 on error.</para>
      </refsect1>
    </refentry>

    <refentry id="function.usbgetstringsimple">
      <refnamediv>
        <refname>usb_get_string_simple</refname>
        <refpurpose>Retrieves a string descriptor from a device using the first language</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>int <function>usb_get_string_simple</function></funcdef>
            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
            <paramdef>int <parameter>index</parameter></paramdef>
            <paramdef>char *<parameter>buf</parameter></paramdef>
            <paramdef>size_t <parameter>buflen</parameter></paramdef>
          </funcprototype>
        </funcsynopsis>
        <para><function>usb_get_string_simple</function> is a wrapper around <function>usb_get_string</function> that retrieves the string description specified by index in the first language for the descriptor and converts it into C style ASCII. Returns number of bytes returned in <varname>buf</varname> or &lt; 0 on error.</para>
      </refsect1>
    </refentry>

    <refentry id="function.usbgetdescriptor">
      <refnamediv>
        <refname>usb_get_descriptor</refname>
        <refpurpose>Retrieves a descriptor from a device's default control pipe</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>int <function>usb_get_descriptor</function></funcdef>
            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
            <paramdef>unsigned char <parameter>type</parameter></paramdef>
            <paramdef>unsigned char <parameter>index</parameter></paramdef>
            <paramdef>void *<parameter>buf</parameter></paramdef>
            <paramdef>int <parameter>size</parameter></paramdef>
          </funcprototype>
        </funcsynopsis>
        <para><function>usb_get_descriptor</function> retrieves a descriptor from the device identified by the <varname>type</varname> and <varname>index</varname> of the descriptor from the default control pipe. Returns number of bytes read for the descriptor or &lt; 0 on error.</para>
        <para>See <xref linkend="function.usbgetdescriptorbyendpoint"> for a function that allows the control endpoint to be specified.</para>
      </refsect1>
    </refentry>

    <refentry id="function.usbgetdescriptorbyendpoint">
      <refnamediv>
        <refname>usb_get_descriptor_by_endpoint</refname>
        <refpurpose>Retrieves a descriptor from a device</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>int <function>usb_get_descriptor_by_endpoint</function></funcdef>
            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
            <paramdef>int <parameter>ep</parameter></paramdef>
            <paramdef>unsigned char <parameter>type</parameter></paramdef>
            <paramdef>unsigned char <parameter>index</parameter></paramdef>
            <paramdef>void *<parameter>buf</parameter></paramdef>
            <paramdef>int <parameter>size</parameter></paramdef>
          </funcprototype>
        </funcsynopsis>
        <para><function>usb_get_descriptor_by_endpoint</function> retrieves a descriptor from the device identified by the <varname>type</varname> and <varname>index</varname> of the descriptor from the control pipe identified by <varname>ep</varname>. Returns number of bytes read for the descriptor or &lt; 0 on error.</para>
      </refsect1>
    </refentry>
  </reference>

  <reference id="ref.bulk">
    <title>Bulk Transfers</title>
    <partintro>
      <para>This group of functions allow applications to send and receive data via bulk pipes.</para>
    </partintro>

    <refentry id="function.usbbulkwrite">
      <refnamediv>
        <refname>usb_bulk_write</refname>
        <refpurpose>Write data to a bulk endpoint</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>int <function>usb_bulk_write</function></funcdef>
            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
            <paramdef>int <parameter>ep</parameter></paramdef>
            <paramdef>char *<parameter>bytes</parameter></paramdef>
            <paramdef>int <parameter>size</parameter></paramdef>
            <paramdef>int <parameter>timeout</parameter></paramdef>
          </funcprototype>
        </funcsynopsis>
        <para><function>usb_bulk_write</function> performs a bulk write request to the endpoint specified by <varname>ep</varname>. Returns number of bytes written on success or &lt; 0 on error.</para>
      </refsect1>
    </refentry>

    <refentry id="function.usbbulkread">
      <refnamediv>
        <refname>usb_bulk_read</refname>
        <refpurpose>Read data from a bulk endpoint</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>int <function>usb_bulk_read</function></funcdef>
            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
            <paramdef>int <parameter>ep</parameter></paramdef>
            <paramdef>char *<parameter>bytes</parameter></paramdef>
            <paramdef>int <parameter>size</parameter></paramdef>
            <paramdef>int <parameter>timeout</parameter></paramdef>
          </funcprototype>
        </funcsynopsis>
        <para><function>usb_bulk_read</function> performs a bulk read request to the endpoint specified by <varname>ep</varname>. Returns number of bytes read on success or &lt; 0 on error.</para>
      </refsect1>
    </refentry>
  </reference>

  <reference id="ref.interrupt">
    <title>Interrupt Transfers</title>
    <partintro>
      <para>This group of functions allow applications to send and receive data via interrupt pipes.</para>
    </partintro>

    <refentry id="function.usbinterruptwrite">
      <refnamediv>
        <refname>usb_interrupt_write</refname>
        <refpurpose>Write data to an interrupt endpoint</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>int <function>usb_interrupt_write</function></funcdef>
            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
            <paramdef>int <parameter>ep</parameter></paramdef>
            <paramdef>char *<parameter>bytes</parameter></paramdef>
            <paramdef>int <parameter>size</parameter></paramdef>
            <paramdef>int <parameter>timeout</parameter></paramdef>
          </funcprototype>
        </funcsynopsis>
        <para><function>usb_interrupt_write</function> performs an interrupt write request to the endpoint specified by <varname>ep</varname>. Returns number of bytes written on success or &lt; 0 on error.</para>
      </refsect1>
    </refentry>

    <refentry id="function.usbinterruptread">
      <refnamediv>
        <refname>usb_interrupt_read</refname>
        <refpurpose>Read data from a interrupt endpoint</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>int <function>usb_interrupt_read</function></funcdef>
            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
            <paramdef>int <parameter>ep</parameter></paramdef>
            <paramdef>char *<parameter>bytes</parameter></paramdef>
            <paramdef>int <parameter>size</parameter></paramdef>
            <paramdef>int <parameter>timeout</parameter></paramdef>
          </funcprototype>
        </funcsynopsis>
        <para><function>usb_interrupt_read</function> performs a interrupt read request to the endpoint specified by <varname>ep</varname>. Returns number of bytes read on success or &lt; 0 on error.</para>
      </refsect1>
    </refentry>
  </reference>

  <reference id="ref.nonportable">
    <title>Non Portable</title>
    <partintro>
      <para>These functions are non portable. They may expose some part of the USB API on one OS or perhaps a couple, but not all. They are all marked with the string _np at the end of the function name.</para>
      <para>A C preprocessor macro will be defined if the function is implemented. The form is LIBUSB_HAS_ prepended to the function name, without the leading "usb_", in all caps. For example, if usb_get_driver_np is implemented, LIBUSB_HAS_GET_DRIVER_NP will be defined.</para>
    </partintro>

    <refentry id="function.usbgetdrivernp">
      <refnamediv>
        <refname>usb_get_driver_np</refname>
        <refpurpose>Get driver name bound to interface</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>int <function>usb_get_driver_np</function></funcdef>
            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
            <paramdef>int <parameter>interface</parameter></paramdef>
            <paramdef>char *<parameter>name</parameter></paramdef>
            <paramdef>int <parameter>namelen</parameter></paramdef>
          </funcprototype>
        </funcsynopsis>
        <para>This function will obtain the name of the driver bound to the interface specified by the parameter <parameter>interface</parameter> and place it into the buffer named <parameter>name</parameter> limited to <parameter>namelen</parameter> characters. Returns 0 on success or &lt; 0 on error.</para>
        <para>Implemented on Linux only.</para>
      </refsect1>
    </refentry>

    <refentry id="function.usbdetachkerneldrivernp">
      <refnamediv>
        <refname>usb_detach_kernel_driver_np</refname>
        <refpurpose>Detach kernel driver from interface</refpurpose>
      </refnamediv>
      <refsect1>
        <title>Description</title>
        <funcsynopsis>
          <funcprototype>
            <funcdef>int <function>usb_detach_kernel_driver_np</function></funcdef>
            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
            <paramdef>int <parameter>interface</parameter></paramdef>
          </funcprototype>
        </funcsynopsis>
        <para>This function will detach a kernel driver from the interface specified by parameter <parameter>interface</parameter>. Applications using libusb can then try claiming the interface. Returns 0 on success or &lt; 0 on error.</para>
        <para>Implemented on Linux only.</para>
      </refsect1>
    </refentry>
  </reference>