misc_ksbridge.txt 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. Introduction
  2. --------------
  3. ksbridge is a simple misc device which bridges Kickstart application
  4. to HSIC h/w. Driver supports two instances, one instance for
  5. flash-less-boot/ram-dumps and other instance for EFS Sync.
  6. Initialization
  7. --------------
  8. Create two bridge instances and register for usb devices 0x9008 and
  9. 0x9048/0x904C. Misc device name depends on the USB PID.
  10. For PID: 9008, misc device name is ks_bridge and for PID:9048/904C,
  11. misc device name is efs_bridge. After KS opens the misc device, IN
  12. URBs will be submitted to H/W; By default IN URBS are configured
  13. to 20.
  14. TX PATH
  15. -------
  16. Transmit path is very simple. Bridge driver will exposes write system
  17. call to kickstart. Data from write call will be put into a list and a
  18. work is scheduled to take the data from the list and write to HSIC.
  19. Functions:
  20. ksb_fs_write: System call invoked when kickstart writes the data
  21. ksb_tomdm_work: Work function which submits data to HSIC h/w.
  22. Data Structures:
  23. to_mdm_list: Data is stored in this list
  24. to_mdm_work: mapped to ksb_tomdm_work function
  25. RX PATH
  26. -------
  27. During initialization 20 IN URBs are submitted to hsic controller. In
  28. completion handler of each URB, buffer is de-queued and add to a list.
  29. Read function is woken-up. A new buffer is created and submitted to
  30. controller.
  31. Functions:
  32. ksb_fs_read: system call invoked by ks when it tries to read the data
  33. ksb_rx_cb: rx urb completion handler
  34. ksb_start_rx_work: function called during initialization.
  35. Data Structures:
  36. ks_wait_q: read system call will block on this queue until data is
  37. available or device is disconnected
  38. to_ks_list: data queued to this list by rx urb completion handler,
  39. later de-queued by read system call.