Updated TODO (markdown)
[librecmc/open-ath9k-htc-firmware.wiki.git] / HTC.md
1 ## HIF - ??
2 Comparable with PHY layer of network interface.
3 Responsible for:  
4 * registering HW interface
5 * uploading firmware
6 * handle PM - suspend, resume. Reset, eject...
7 * complete low level rutine. In this case USB.
8
9 ## HTC - host target communications  
10 Has static Endpoint = 0.
11 Responsible for:  
12 * Communication between host and target
13 * Registering services. For example WMI, RX, TX, Beacon...
14 * Routing messages to services
15 * credits system.
16
17 ## WMI – Wireless Module Interface Service  
18 Responsible for:  
19 * any kind of mac access, abstract or direct - register access.
20
21 ## Proposal:  
22 We need method to handle system exceptions and send system message for debuging.
23 It should use shortest path, and have guaranteed existence btw endpoint.
24 On one sight HIF has shortest path, on other sight it is responsable only for PHY level.
25 In this case IMO, HTC is best choice.
26
27 Current htc_frame_header accept fallowing flags:  
28 * HTC_FLAGS_NEED_CREDIT_UPDATE
29 * HTC_FLAGS_RECV_TRAILER
30 * HTC_FLAGS_CREDIT_REDISTRIBUTION
31
32 I suggest to add two more:  
33 * HTC_FLAGS_EXCEPTION - target firmware filed and can't continue to work... with other words, we have a bug and should fix it.
34 * HTC_FLAGS_DMESG - send some debug information to the host.
35
36 In case of exception best what we can do is to gather as match as possible debug information. And find some way to rest target:
37 - reboot - we need running firmware. won't reinit hardware. (some times we need it)
38 - cold reboot - we need running firmware. will force host to send disconnect event (driver will be automatically reloaded)
39 - usb reset - not always working?