Contents in Detail xv
15
USB DRIVERS 257
About USB Devices................................................................................................ 257
More About USB Devices ....................................................................................... 258
USB Configuration Structures .................................................................................. 259
Mandatory Fields ..................................................................................... 260
Optional Fields ........................................................................................ 260
USB Transfer Flags ................................................................................... 261
USB Transfers (in FreeBSD) ..................................................................................... 262
USB Configuration Structure Management Routines ................................................... 264
USB Methods Structure........................................................................................... 265
Tying Everything Together ...................................................................................... 266
ulpt_probe Function .................................................................................. 270
ulpt_attach Function.................................................................................. 271
ulpt_detach Function................................................................................. 273
ulpt_open Function ................................................................................... 273
ulpt_reset Function.................................................................................... 274
unlpt_open Function ................................................................................. 275
ulpt_close Function ................................................................................... 276
ulpt_ioctl Function..................................................................................... 276
ulpt_watchdog Function ............................................................................ 277
ulpt_start_read Function ............................................................................ 277
ulpt_stop_read Function ............................................................................ 278
ulpt_start_write Function ............................................................................ 278
ulpt_stop_write Function ............................................................................ 278
ulpt_write_callback Function ...................................................................... 279
ulpt_read_callback Function ...................................................................... 280
ulpt_status_callback Function ..................................................................... 281
Conclusion ........................................................................................................... 282
16
NETWORK DRIVERS, PART 1: DATA STRUCTURES 283
Network Interface Structures ................................................................................... 283
Network Interface Structure Management Routines .................................................... 286
ether_ifattach Function .............................................................................. 287
ether_ifdetach Function ............................................................................. 288
Network Interface Media Structures ......................................................................... 289
Network Interface Media Structure Management Routines .......................................... 289
Hello, world! ........................................................................................................ 291
mbuf Structures ..................................................................................................... 293
Message Signaled Interrupts................................................................................... 294
Implementing MSI ................................................................................................. 294
MSI Management Routines ..................................................................................... 297
Conclusion ........................................................................................................... 297